2.1 KiB
2.1 KiB
QA: document title (SPA, Vitest only)
Automated (Vitest + Vue Test Utils, real route table, memory history, mocked /v1)
Each test resets document.title to "" in beforeEach.
- Back-office rows: with
/v1user mocked as signed in and verified, push each path from the first Examples table, awaitrouter.isReady(), assertdocument.title. - Auth rows: with the session mocked as signed out (401), push each path of the auth Examples table and assert the title equals the card heading plus " · RenewCMS". For the verify noSession row, mock a verify attempt with no session.
- Verify with a code and no heading: assert
document.title === 'RenewCMS'. - Auth heading change: drive an auth screen through two states with different headings (e.g. reset request default to the incomplete/expired variant) and assert the title follows.
- Navigation sequence: /home, /media, /home, asserting after each push.
- Login redirect: from /login simulate a successful login so the guard redirects to /home; assert "Home · RenewCMS".
- Logout: from /settings trigger logout; assert "Log in · RenewCMS".
- Editor: mock GET article 42 with a pending promise, assert "Editor · RenewCMS"; resolve with title "Hello world", assert "Hello world · RenewCMS". Save with title "Hello again" and assert the update. Repeat with a failing GET and with an empty title, expecting "Editor · RenewCMS". Navigate to /article and assert "Articles · RenewCMS".
- Not found: push an unknown path, assert "404 · RenewCMS".
- Locale: set
fr, push /media, assert the French name plus " · RenewCMS"; switch toenand assert "Media · RenewCMS" without a navigation. - Update
web/src/components/__tests__/AuthShell.spec.tsif its title expectations no longer hold once the title is set in one place.
Visual
None. The tab title is not drawn on any board (skip: not-visual).
Manual
- In a real browser, log in from /login and confirm the tab reads "Home · RenewCMS", then use the sidebar and the browser Back and Forward buttons and confirm the tab follows.
- Open an article in the editor, edit its title, and confirm the tab and the history entry follow.