\n ",
);
// When: request-time navigation constraints are inspected.
// Then: pending request state cannot disable read-only session switching.
assert.doesNotMatch(sessionNavigation, /disabled=\{/);
});
test("uses the compact model popup width", () => {
// Given: the model selector popup styles.
const popupStyles = sourceBetween(globalStyles, ".model-selector-popup {", "}\n.model-selector-popup[data-starting-style]");
// When: its responsive width is inspected.
// Then: the desktop cap is half of the former 360px width.
assert.match(popupStyles, /width:\s*min\(180px,/);
});
test("centers the credit value with its icon", () => {
// Given: the credit value styles next to the existing flex-centered icon.
const creditValueStyles = sourceBetween(globalStyles, ".credit-button span {", "}\n.credit-button .credit-icon");
// When: the value line box is inspected.
// Then: it participates in flex centering without extra line-height drift.
assert.match(creditValueStyles, /display:\s*inline-flex/);
assert.match(creditValueStyles, /align-items:\s*center/);
assert.match(creditValueStyles, /line-height:\s*1/);
});
test("routes account actions through a popover and focused dialogs", () => {
// Given: the account surface state and entry-point handlers.
// When: the page source is inspected for independent menu and dialog routes.
// Then: each account task has a focused destination instead of one combined sheet.
assert.match(pageSource, /const \[accountMenuOpen, setAccountMenuOpen\] = useState\(false\)/);
assert.match(pageSource, /const \[activeAccountDialog, setActiveAccountDialog\] = useState\(null\)/);
assert.match(pageSource, /className="account-menu"/);
assert.match(pageSource, /openAccountDialog\("profile"/);
assert.match(pageSource, /openAccountDialog\("redeem"/);
assert.match(pageSource, /openAccountDialog\("logout"/);
});
test("removes the monolithic account sheet", () => {
// Given: the former sheet implementation names.
// When: the page and global styles are inspected.
// Then: no right-side account sheet remains.
assert.doesNotMatch(pageSource, /profile-overlay|profile-dialog|openAccount\(/);
assert.doesNotMatch(globalStyles, /\.profile-overlay|\.profile-dialog/);
});
test("keeps admin navigation separate from account task dialogs", () => {
// Given: the administrator-only route and the new account menu.
// When: their source relationship is inspected.
// Then: code management stays a guarded navigation action rather than a modal.
assert.match(pageSource, /account\?\.isAdmin\s*&&\s*]+href="\/admin\/codes"[^>]+role="menuitem"/);
});