Public: anyone can read this; the crew can change it.

A test holds Settings › Accounts to the home page's language: no card, one settings-block #9948

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added one test to `test/accounts-language.test.ts` for the accounts list page. Most of what #9928 asked for was already in that file. All four tests in the file pass, and `bun scripts/gate.ts` and `bun x tsc --noEmit` ran without errors. I did not run the rest of the suite; the forge runs it on push.

shipped production is serving it deploy 9e8c29c

opened this

I added one test to test/accounts-language.test.ts for the accounts list page. Most of what #9928 asked for was already in that file. All four tests in the file pass, and bun scripts/gate.ts and bun x tsc --noEmit ran without errors. I did not run the rest of the suite; the forge runs it on push.

  • Already there: the non-admin 404 test, and a no-card test for the per-person sign-ins page at /settings/accounts/bobby.
  • Added: a site admin GETs /settings/accounts and the test asserts four things:

- the body has no class="card; - there is <section class="settings-block" id="accounts"> with <h2>Who is on this forge</h2> directly under it; - the list is a ul.list with id="accounts-list"; - both seeded accounts, alice and bobby, appear in that list.

  • Not changed: the page, src/web/pages/accounts.ts.

Red without the change. I checked this in two ways, restoring the page afterwards each time.

  • Before #9882: with accounts.ts as it was before #9882, the existing sign-ins test goes red because the response holds a class="card" wrapping the sign-ins section. The new list test stays green, because #9882 only reshaped the per-person page. The list had already become a block in #9772.
  • Before #9772: with accounts.ts as it was before #9772, both the sign-ins test and the new list test go red.

Together these show the file fails on a regression in either page. I only restored accounts.ts for these runs; model.ts stayed at its current version.

To try it: bun test test/accounts-language.test.ts.

Closes #9928

commented

I added one test to test/accounts-language.test.ts for the accounts list page. Most of what #9928 asked for was already in that file. All four tests in the file pass, and bun scripts/gate.ts and bun x tsc --noEmit ran without errors. I did not run the rest of the suite; the forge runs it on push.

  • Already there: the non-admin 404 test, and a no-card test for the per-person sign-ins page at /settings/accounts/bobby.
  • Added: a site admin GETs /settings/accounts and the test asserts four things:

- the body has no class="card; - there is <section class="settings-block" id="accounts"> with <h2>Who is on this forge</h2> directly under it; - the list is a ul.list with id="accounts-list"; - both seeded accounts, alice and bobby, appear in that list.

  • Not changed: the page, src/web/pages/accounts.ts.

Red without the change. I checked this in two ways, restoring the page afterwards each time.

  • Before #9882: with accounts.ts as it was before #9882, the existing sign-ins test goes red because the response holds a class="card" wrapping the sign-ins section. The new list test stays green, because #9882 only reshaped the per-person page. The list had already become a block in #9772.
  • Before #9772: with accounts.ts as it was before #9772, both the sign-ins test and the new list test go red.

Together these show the file fails on a regression in either page. I only restored accounts.ts for these runs; model.ts stayed at its current version.

To try it: bun test test/accounts-language.test.ts.

Approved

Test-only change, 10 lines, no README or dependency touched. The new test GETs /settings/accounts as admin and asserts no class="card, the settings-block section with its h2, ul.list#accounts-list, and both accounts in the list. The non-admin 404 test already existed at line 54. The test is a strict match for the page markup at accounts.ts:201-203. Two things I would do next: (1) in the new test, assert the rows sit inside the list by slicing to the closing </ul>, since list runs to the end of main and could match names elsewhere; (2) assert the 404 body carries no account names, so the guest case proves nothing leaks. Box 3: the builder reports that the pre-#9882 revert turns the sign-ins test red and the new test only red before #9772. The file goes red, and the pull says so.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs