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.

Every seeded account holds one student number for good, so a number is shared by every spec that drives that account. Isolation is per (student number, course code) instead: the mock and the workers are global, so no two specs may drive the same account on the same course. LANE_COMPLETIONS and the table in system-tests/src/utils/creditRegistration.ts allocate them. Numbers are digits only, 6โ€“12 of them, per verified_student_numbers.student_number_format, the leading 9 keeping them clear of real UH numbers.

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 course unit for one module looks like. The defaults are the working shape; the import-outcomes modules each break exactly one of them.
LaneCompletion
A seeded completion on one of the two general Suotar courses, and the enrolments the registry holds for it. Without one the row parks at no_usable_enrolment, or waits for its spec to create the enrolment after arming a fault, so no earlier unscoped sweep can import the row first.
MockPersonFixture
A Sisu person, and the seeded account it belongs to if any. The database rows and the pushed persons must carry the same identifiers, so both are built from here.

Constantsยง

ADMIN_COURSE_ID
Owned by suotar-admin-dashboard.spec.ts: discovery and the linking mails tick by course, so the spec that ticks them needs a roster no other specโ€™s unlinked people are on.
ADMIN_COURSE_SLUG
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.
CREDIT_REGISTRATION_STUDENT_1
Created and linked to this number by the credit-registration seed, like the four below.
CREDIT_REGISTRATION_STUDENT_2
Linked by support by hand rather than by the mailed link, which the teacher view renders differently.
CREDIT_REGISTRATION_STUDENT_3
CREDIT_REGISTRATION_STUDENT_4
CREDIT_REGISTRATION_STUDENT_5
CREDIT_REGISTRATION_STUDENT_6
CRS_101
CRS_ADMIN_101
CRS_B_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
DEGREE ๐Ÿ”’
GRADE_IMPROVEMENT_COURSE_ID
Owned by suotar-grade-improvement.spec.ts, and the only graded module here.
GRADE_IMPROVEMENT_COURSE_SLUG
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
LANE_COMPLETIONS
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.
NOT_ENROLLED ๐Ÿ”’
OLD_FLOW_COURSE_ID
A course left on the legacy open-university pull flow, for the coexistence specs.
OLD_FLOW_COURSE_SLUG
RETRY_COURSE_ID
Owned by suotar-teacher-views.spec.tsโ€™s retry half, and swept by its bulk retry.
RETRY_COURSE_SLUG
STATES_COURSE_CODES
One module per column of the frozen-row grid: an account holds one completion per module.
STATES_COURSE_ID
One frozen ledger row per registration state and per error code, on paused modules. Read by suotar-teacher-views.spec.ts and the admin explorer, written by neither.
STATES_COURSE_SLUG
STUDENT_6
A general seeded student the credit-registration seed links to this number, like student7 and student8. Kept off every row that asks something of the student: suotar-student-profile.spec.ts asserts its studies page is clean.
STUDENT_7
STUDENT_8
SUOTAR_B_COURSE_ID
A second general Suotar course, so one account can serve a spec on each.
SUOTAR_B_COURSE_SLUG
SUOTAR_COURSE_ID
The general Suotar course, and the only one with a chapter page to read.
SUOTAR_COURSE_SLUG
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.

Functionsยง

enrolment ๐Ÿ”’
mock_suotar_world
The world the mock Suotar serves, built from the same fixtures the database rows are.
person ๐Ÿ”’