Skip to content

test(e2e): verify the kanban spec against a sane clock, then fix whatever selectors actually mismatch #577

Open

Description

@thinkclay

The third and final blocker on #553, found by running the spec once the auth blockers (#574, #575) were cleared.

The mismatch

tests/infrastructure/playwright/helpers/helpers/kanban-helpers.ts locates a column three ways:

page.locator(`[data-column="${column}"]`)
  .or(page.locator(`[data-status="${column}"]`))
  .or(page.getByTestId(`kanban-column-${column}`))

packages/scf-core/features/office/applications/components/ApplicationsKanbanBoard.tsx renders none of them. It contains no testID, no data-testid and no nativeID anywhere — grep returns nothing. So all three strategies match nothing and waitForKanbanLoad times out at 30s.

Every one of the 20 tests in test-office-applications-kanban.spec.ts goes through waitForKanbanLoad in a beforeEach, so all 20 fail identically regardless of what is on the board.

Why this was invisible

The spec has never run. #553 established it was excluded from testMatch; #575 established the seeded accounts could not authenticate. With both cleared, the spec now reaches the app and fails on selectors instead — which is the first time this mismatch could be observed.

Note the helpers were written defensively, trying three selector strategies. That reads like care, but none of the three was ever checked against the component, so the redundancy bought nothing. Worth remembering: fallback selectors are not evidence that any of them work.

Work

Pick one, and prefer the first:

  1. Add test hooks to the component. data-testid="kanban-column-<status>" on each column, and a stable id per card. This is the durable option: the helpers already look for exactly this and the board is the thing under test.
  2. Rewrite the helpers against what the board actually renders. Fragile — the board has no stable hooks at all, so this means matching on text or structure.

Then work through the rest of kanban-helpers.ts; column lookup is the first failure, not necessarily the only mismatch. Expect more of them, and add specs to testMatch one at a time as #553 sequences.

Acceptance

agent-ready: the change is confined to one component and one helper file, and success is objectively checkable by running the spec.

Activity

  1. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    I filed this issue on a wrong diagnosis. Correcting it.

    I claimed ApplicationsKanbanBoard renders no testID, data-testid or nativeID, and that kanban-helpers.ts waits on selectors matching nothing.

    That is false. @scaffald/ui already sets them:

    • KanbanColumn.tsx:35 — testID={kanban-column-${id}}
    • KanbanCard.tsx:23 — testID={kanban-card-${id}}

    Both are present in the built dist/, and testID maps to data-testid under react-native-web in this app (mode-selector proves the mechanism works). My grep was scoped to features/office/applications/components/ — the board composes the hooks from the UI package rather than declaring them locally, so it found nothing and I inferred a mismatch from an empty page snapshot instead of checking the component.

    The real blocker, in two parts

    1. The auth session was stored under a key the client never reads. auth.setup.ts built sb-127-0-0-1-54321-auth-token from the full host; supabase-js uses the first hostname label, sb-127-auth-token. Every storage state ever written by this setup held a valid session the app could not see — so specs authenticated and then rendered the login screen. Fixed in #578.

    2. This machine's Supabase container clock is 26 hours behind the host, so every token it issues is already expired by browser time:

    token iat=1786405275  exp=1786408875
    host  now=1786498798     ->  26.0 hours behind
    

    No browser session can survive that, whatever key it lives under. It also explains the JWT issued at future rejections PostgREST was returning earlier in this epic — I worked around those by backdating minted JWTs and did not follow the thread to its cause at the time.

    What this issue should now be

    Re-scoped to: verify the kanban spec against a sane clock, and fix whatever selector mismatches actually turn up. There may be none. There may be several. The honest position is that nobody has yet seen the spec reach the board, so nobody knows — and I should not have written an issue that asserted otherwise.

    Keeping it open under that description rather than closing it, since the verification still has to happen.

  2. changed the title [-]test(e2e): the kanban helpers wait on selectors ApplicationsKanbanBoard never renders[/-] [+]test(e2e): verify the kanban spec against a sane clock, then fix whatever selectors actually mismatch[/+] on Aug 12, 2026
  3. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    Progress and a hard stop.

    Merged #578 — the auth session is now written under sb-127-auth-token, the key supabase-js actually reads, rather than sb-127-0-0-1-54321-auth-token. Verified locally (typecheck clean, setup project selects its 3 tests, correct key present in the generated admin.json / user.json). Merged without CI because Actions has been unable to start jobs repo-wide since ~00:28 UTC.

    Still blocked on the clock, and now on Docker itself. The local container clock was 26 hours behind the host — the VM had been up for seven days. Restarting Docker Desktop was the fix; the app relaunched but has not started a VM, so Supabase is down and the spec cannot be run at all. That needs someone at the machine.

    What is left here, precisely

    Once Docker is back and the clock is sane:

    1. rm -rf tests/.auth && npx playwright test --config=playwright.config.ts --project=setup — should produce all three files with a non-expired token.
    2. Run test-office-applications-kanban.spec.ts and see how far it gets.
    3. Fix whatever selectors actually mismatch — possibly none, since KanbanColumn and KanbanCard already emit kanban-column-* and kanban-card-*.
    4. Then test(e2e): the office suite never runs — excluded from testMatch, and its auth setup is outside testDir #553 can add it to testMatch.

    Step 3 is still unmeasured. I am not going to guess at it again — guessing is what produced the wrong first version of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions