Scope the profile-menu assertion to the menu itself
CI / full-gate (push) Successful in 2m38s
Mirror / github-mirror (push) Successful in 7s

This commit was merged in pull request #50.
This commit is contained in:
2026-08-05 01:08:09 +02:00
parent 3c64621515
commit 64d1387df2
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -39,7 +39,9 @@ test("app shell renders sidebar, topbar and the content slot", async () => {
// Sign out is a CSRF-guarded POST form (state change, not a GET link), carrying the token.
assert.match(html, /<form class="menu-item-form" method="post" action="\/logout">/);
assert.match(html, /<input type="hidden" name="_csrf" value="tok\.sig" \/>/);
assert.doesNotMatch(html, /<button class="menu-item" type="button"/); // every item in the menu goes somewhere
// …and it is the profile menu's only control: nothing dead sits beside it.
const profileMenu = html.slice(html.indexOf('<div class="menu-pop'), html.indexOf("</details>"));
assert.deepEqual(profileMenu.match(/<button/g), ["<button"]);
// Branding, document title, and the inlined icon sprite (so <use> resolves).
assert.match(html, /Acme Console/);