E2E — an admin reaches the lessons from settings, reads one, and a non-admin never sees the door
The story's acceptance walk, in a browser, as a person.
Follow the ACCESS PATH the design drew — start where a user actually starts, not at a deep link. Navigate from the settings surface to the lessons, because "can you find it" is a real assertion about this feature and a page.goto of the final route silently skips it.
The walk:
- Sign in as a project admin, open project settings, reach AI planning.
- Reach the lessons through the drawn affordance.
- See the seeded lessons listed.
- Open one; read its full text, its axes and its dates.
- Sign in as a non-admin: the entry point is not there.
Also cover the empty state — a project with no lessons shows the designed empty screen, not a blank panel. That is the first thing most users will see and the only screen that explains the feature.
Seed through the service, not by raw insert. A row inserted straight into the table can carry a shape the service would never produce, and the test then passes against data the product cannot create.
Acceptance criteria
- The walk above passes, navigating from settings rather than a deep link.
- The non-admin case asserts the entry point is absent, and that a direct request to the route is refused.
- The empty-state case renders the designed screen for a project with no lessons.
- Lessons are seeded through the service.
- The spec runs in the E2E lane and passes in CI.
- Selectors follow the repo's existing convention; no new selector pattern.
Context refs
motir-coretests/e2e/— the lane, its fixtures, sign-in helpers and selector conventions.motir-coredesign/ai-settings/— the access path this walk follows.- MOTIR-3338 — the UI under test.
- MOTIR-3336 — the permission the non-admin case exercises.