Skip to main content

Module fixtures

Module fixtures 

Source
Expand description

The fixture identities the credit-registration (Suotar) system tests are built from.

The seed writes the database rows and the mock study registry serves the matching registry rows, so neither side owns these: both read them here.

Student numbers are 90000SSPP: SS the spec index listed below, PP the person within that spec, the leading 9 keeping them clear of real UH numbers. Digits only, 6–12 of them, per verified_student_numbers.student_number_format.

Account linking and worker ticks are both global — one spec’s tick advances every eligible row in the shared database — so two specs sharing a student number would see each other’s registration attempts. Each spec under system-tests/src/tests/credit-registration/ owns one SS, and the mock Suotar’s persons must reuse the same numbers: 02 suotar-account-linking, 03 suotar-enrolment-problems, 04 suotar-import-outcomes, 05 suotar-verify-outcomes, 06 suotar-sisu-outage, 08 suotar-teacher-views, 09 suotar-admin-dashboard, 10 suotar-old-flow-coexistence, 11 suotar-backfill, 12 suotar-grade-improvement, 13 suotar-student-emails, 14 suotar-fast-track-linking, 15 suotar-in-course-banner, 16 suotar-student-profile. 01 belongs to no single spec: it holds the linked and unlinked students that read-only specs share. 07 is unused.

Names and emails are unlikely strings (Zzyzx …) because a spec asserts their absence from the scrubbed Suotar API log.

Structs§

CourseUnitShape 🔒
What the mock’s realisation for one module looks like. The defaults are the working shape; the import-outcomes modules each break exactly one of them.
MockPersonFixture
A seeded student and the Sisu person the mock must answer with for them. The database rows and the pushed persons must carry the same identifiers, so both are built from here.

Constants§

ADMIN_COURSE_ID
Owned exclusively by suotar-admin-dashboard.spec.ts: discovery and the linking mails tick by course, so the spec that ticks them needs a course no other spec has students on.
ADMIN_COURSE_SLUG
ADMIN_LINKED
ADMIN_STALE
Mailed to the cap, never claimed, no account: the stale-address population is the only place the resend and manual-link actions render.
ADMIN_UNLINKED
BACKFILL_COURSE_ID
Owned outright by suotar-backfill.spec.ts, which flips the Suotar flag on.
BACKFILL_COURSE_SLUG
BACKFILL_STUDENTS
BANNER_REENROLS
Its own person, because its spec creates the enrolment that makes the banner go away and that must not clear another spec’s banner.
BANNER_STUCK
Absent from the mock’s enrolments, like NO_ENROLMENT, so its row parks where the in-course re-enrol banner shows. Its spec only reads and dismisses, so the row stays parked.
CRS_101
CRS_102
CRS_ADMIN_101
CRS_BACKFILL_101
CRS_GRADED_101
CRS_IMPORT_101
One module per import failure, each breaking exactly one thing.
CRS_IMPORT_102
CRS_IMPORT_103
CRS_IMPORT_104
CRS_OLD_101
CRS_OLD_102
The module suotar-old-flow-coexistence.spec.ts treats as already cut over: Suotar-enabled, but holding a completion the legacy pull path registered before the cutover happened.
CRS_RETRY_101
CRS_STATES_101
EMAILS_NO_ENROLMENT
Deliberately absent from the mock’s enrolments, like NO_ENROLMENT, so its row parks at no_usable_enrolment and earns the action-needed mail without arming a fault.
EMAILS_REGISTERED
Driven all the way to registered, which is what earns the “your credits are in Sisu” mail.
FAST_TRACK_HAS_NUMBER
Its account already holds FAST_TRACK_OTHER_NUMBER, so swapping it belongs behind the mailed link’s confirmation screen, which names both numbers.
FAST_TRACK_NAME_MISMATCH
The recycled-address signal: the address is proved, but the account belongs to somebody else. seed_fast_track_near_misses gives its account a name unlike the registry’s.
FAST_TRACK_NO_MATCH
A confirmed account whose address the registry simply does not hold. The population the linking mail exists for, and the regression that matters most: it must still be mailed.
FAST_TRACK_OTHER_NUMBER
Not on any roster: only the account’s existing link needs it to exist.
FAST_TRACK_SECONDARY_ONLY
mock_suotar_world moves its account address to the registry’s secondary field, which is self-entered there and therefore never proof.
FAST_TRACK_STALE
Verified far outside the recency window: a deprovisioned university address can be reissued, and the account holding it would still look verified.
FAST_TRACK_TWIN
FAST_TRACK_VERIFIED
Its Sisu address equals the account address, which is what the fast track fires on; the twin below differs only in the account’s verification flag.
GRADE_IMPROVEMENT
GRADE_IMPROVEMENT_COURSE_ID
Owned by suotar-grade-improvement.spec.ts, and the only graded module here.
GRADE_IMPROVEMENT_COURSE_SLUG
IMPORT_OUTCOMES
IMPORT_OUTCOMES_COURSE_ID
Owned by suotar-import-outcomes.spec.ts; its modules are the failing shapes.
IMPORT_OUTCOMES_COURSE_SLUG
IMPORT_OUTCOME_COURSE_CODES
IMPORT_TIMEOUT
The import that times out. Its own person, so the fault keyed on this student number cannot reach another spec’s row on the shared course.
LINKED_STUDENT
Linked to its student number from seed time: suotar-student-profile.spec.ts reads its linked card.
LINK_CLAIMER_EMAIL
Claims the seeded linking tokens, and holds no student number of its own: the tokens are unbound and bind to whoever opens the link.
LINK_EXPIRED
LINK_USED
LINK_VALID
MAILED_ADDRESS_SUFFIXES
Three distinct addresses out of one Sisu address: the dedup key is the address and the cap is three mails per person and course.
NO_ENROLMENT
Deliberately absent from the mock’s enrolments: the only way to reach no_usable_enrolment without arming a fault.
OLD_FLOW_COURSE_ID
A course left on the legacy open-university pull flow, for the coexistence specs.
OLD_FLOW_COURSE_SLUG
PROFILE_EMPTY_EMAIL
Enrolled on a Suotar course and nothing else, for the profile tab’s empty state.
RETRY_COURSE_ID
Owned by suotar-teacher-views.spec.ts’s retry half, and swept by its bulk retry.
RETRY_COURSE_SLUG
SISU_OUTAGE
The outage spec’s own person, so a fault keyed on this student number cannot reach another spec’s row on the shared course. Enrolment left unseeded for IMPORT_TIMEOUT’s reason: its spec arms the outage before creating the enrolment, so no earlier unscoped sweep can import the row while the study registry is still answering normally.
STATES_COURSE_ID
One frozen ledger row per registration state and per error code, on a paused module. Read by suotar-teacher-views.spec.ts and the admin explorer, written by neither.
STATES_COURSE_SLUG
SUOTAR_COURSE_ID
The course the Suotar specs live on.
SUOTAR_COURSE_SLUG
SUPERSEDED
TEACHER_RESEND_CAPPED
A second capped person on ADMIN_STALE’s course, owned by the teacher specs so a cap-refused resend cannot race whichever spec is overriding the cap.
TWO_ENROLMENTS
Enrolled on one course twice, through a degree programme and through the open university, so the selection policy has something to choose between.
UNLINKED_STUDENT
The twin with no student number linked, enrolled and nothing more.
VERIFY_MISREGISTERED
VERIFY_POLLING

Functions§

enrolment 🔒
mock_suotar_world
The world the mock Suotar serves, built from the same fixtures the database rows above are.
person 🔒
product_id
product_token 🔒