Skip to content

fix(seeds): get demo accounts past the legal gate, and the e2e users past onboarding - #576

Merged
thinkclay merged 1 commit into
mainfrom
claude/seed-onboarded
Aug 12, 2026
Merged

thinkclay merged 1 commit into
mainfrom
claude/seed-onboarded

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #575.

Two problems. The first affected every demo account, not just the e2e ones.

1. The legal versions were hardcoded and had gone silently stale

The seed wrote privacy_policy_version = '1.0' / terms_of_service_version = '1.0'. Migration 342 later made core.legal_documents the source of truth and publishes 'v1.0'. The check is a string equality:

needsAcceptance: !acceptedAt || acceptedVersion !== doc.version

'1.0' !== 'v1.0', so every demo user has been legally stale since 342 landed — past /onboarding, bounced to /legal-update. That is why loading tests/.auth/super-admin.json and navigating to /office/applications produced the public marketing page.

The seed now reads the version from core.legal_documents rather than hardcoding it. Updating the literal to 'v1.0' would have worked until the next publish; deriving it means the next bump cannot desync the seed again.

2. Two of the three accounts auth.setup.ts uses were not in this seed

[email protected] and [email protected] had a name but no address, no user_types and no industry_id — failing the prerequisites check on three counts and landing on /onboarding. Both are now seeded alongside the existing demo users in steps 2, 3 and 4.

Verified, not assumed

check result
demo accounts past every gate 9/9
GET /v1/prerequisites/check isComplete=true, needsOnboarding=false, needsLegalAcceptance=false
Playwright setup project 3 passed (was 1 passed / 1 failed / 1 flaky)
storage-state files admin.json, user.json, super-admin.json — all three
specs reach the app yes — no longer the marketing page

There is a third blocker, and it is not this one

The office kanban spec still cannot go into testMatch. Now that auth works I ran it, and it fails on selectors: ApplicationsKanbanBoard renders no testID, data-testid or nativeID anywhere, while kanban-helpers.ts waits on [data-column="new"], [data-status="new"] and kanban-column-new. Those match nothing in the implementation, so the spec cannot pass on any data. The comment in playwright.config.ts records that, and it is filed separately.

This is the same shape as the rest of the #539 epic: ~30 tests and a helper library written against an implementation they were never run against.

…past onboarding

Closes #575.

Two problems, one of which affected every demo account rather than just the
e2e ones.

1. Legal versions were hardcoded and had silently gone stale.

   The seed wrote privacy_policy_version = '1.0' and
   terms_of_service_version = '1.0'. Migration 342 later made
   core.legal_documents the source of truth and publishes 'v1.0'. The check
   is a string equality — `acceptedVersion !== doc.version` — so '1.0' has
   not matched since 342 landed.

   Every demo user was therefore past /onboarding but bounced to
   /legal-update. That is why loading tests/.auth/super-admin.json and
   navigating to /office/applications produced the public marketing page.

   The seed now reads the version from core.legal_documents instead of
   hardcoding it, so the next version bump cannot desync it again. That is
   the actual fix — updating the literal to 'v1.0' would have worked until
   the next publish.

2. Two of the three accounts auth.setup.ts uses were not in this seed.

   [email protected] and [email protected] had a name but no
   address, no user_types and no industry_id, so they failed the
   prerequisites check on three counts and landed on /onboarding. Both are
   now seeded in steps 2, 3 and 4 alongside the existing demo users.

Verified rather than assumed:

  - 9/9 demo accounts pass every gate the prerequisites check applies.
  - GET /v1/prerequisites/check returns isComplete=true,
    needsOnboarding=false, needsLegalAcceptance=false.
  - The Playwright setup project goes from 1 passed / 1 failed / 1 flaky to
    3 passed, producing admin.json, user.json and super-admin.json.
  - Specs now reach the app rather than the marketing page.

The office kanban spec still cannot be added to testMatch, for a third
reason that is not this one: ApplicationsKanbanBoard renders no testID,
data-testid or nativeID anywhere, while kanban-helpers.ts waits on
[data-column], [data-status] and kanban-column-*. Those selectors match
nothing in the implementation, so the spec cannot pass on any data. Filed
separately; the comment in playwright.config.ts says so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(e2e): no seeded user can reach a protected route — onboarding and legal gates block every office spec

1 participant