[follow-up] AppViewUI integration test predates role-based home + owner_handle form

closed
#1344bf0 opened by agent Sep 13

Context

Surfaced by the T3 (bug a6181d9) SQLite re-verification run: with SOVRN_INTEGRATION=1, TestIntegrationAppViewUI fails at step 1 — home missing title. The page renders correctly; the test’s expectation is stale.

Problem

Commit znmtsqru (role-based auth, non-admin home page) split internal/appview/ui/home.templ by role: admins see “Your domains”, non-admins see “My mailboxes”. The test’s DevDID session (did:plc:uiprobe...) is non-admin, so the "Your domains" assertion (internal/integration/appview_ui_test.go:85) fails. Step 1’s failure masks further drift behind it — notably step 4 posts only address to /domains/{id}/accounts, but the form now requires owner_handle (422 without it, see internal/appview/ui/create_account_test.go:55) or the new_account checkbox.

Task

  • Make the step-1 expectation role-aware (non-admin DevDID renders “My mailboxes”).
  • Supply owner identity at step 4 (owner_handle resolvable in the integration env, or new_account=1); confirm the created mailbox still satisfies the later IMAP-login proof.
  • Re-run steps 2-7 and fix fallout (domain creation as non-admin, DNS/IMAP-guide strings, secret regex) iteratively. If any step exposes a production regression under the role model rather than test drift, split it into its own bug.

Acceptance

  • TestIntegrationAppViewUI passes end-to-end against the live harness (home -> add domain -> DNS records -> add account -> IMAP guide -> app password -> IMAP login). Test-only unless a real regression surfaces.

1 Comment

agent 1d33444 Sep 13

Fixed (bugs ca92d38 + 1344bf0)

ca92d38 — internal/integration/apppassword_xrpc_test.go:89, appview_test.go:95 now pass Did: strPtr(cfg.DevAuth.DID). Both green.

1344bf0 — internal/integration/appview_ui_test.go updated: non-admin home expects “My mailboxes”; account creation uses new_account=1; DNS assertions match the Type/Name/Content table; secret extraction reads the <code data-copy> attribute (secret is now chunked into spans). Unique domain per run (ui-probe-<nanos>.test) so the shared harness can’t collide with stale state — full flow green including IMAP login on the pending mailbox.

Full suite: 8⁄8 PASS with SOVRN_INTEGRATION=1; unit just test green; gofmt/vet clean.

Harness note

Wiped stale Sept-9 ui-probe.test objects (domain c0, account ed at 5⁄5 app-password quota, tenant c3) from the dev Stalwart — that staleness was the order-dependent 500, not a code bug. No prod code touched by either fix; both bugs stay open for your review.