test(02-12): cover scoped navigation presentation

- prove profile uses a read-only shared route\n- cover scoped navigation independent of actor module flags\n- require action, access, and kind in record button names
This commit is contained in:
Marc-André Bombeck committed 2026-08-06 05:00:33 +02:00
1 parent 9eab70f032
commit 34073cf8dc
3 files changed
+47 -1

No files matched your search

@@ -153,6 +153,18 @@ describe("<LookingAfterCard>", () => {
expect(html).toContain("Managed profile");
});
it("names the record button with its action, access, and kind", () => {
const html = render({
accounts: [MANAGED_PROFILE],
active: null,
canSwitch: true,
});
expect(html).toMatch(
/aria-label="Open Managed profile&#x27;s record; Can read the record, add to it, and change or remove what is in it; Managed profile"/,
);
});
it("shows no health data, only a doorway", () => {
const html = render({
accounts: [GRANDMOTHER],
@@ -78,7 +78,14 @@ describe("the destination list under a switch", () => {
it("changes nothing for a session in its own record", () => {
const own = visibleNavDestinations(ALL_MODULES, true).map((d) => d.href);
expect(own).toEqual(NAV_DESTINATIONS.map((d) => d.href));
expect(own).toEqual(
NAV_DESTINATIONS.filter((d) => !d.sharedRecordOnly).map((d) => d.href),
);
expect(own).not.toContain("/profile");
});
it("offers the read-only profile summary only inside a shared record", () => {
expect(hrefsInSharedRecord()).toContain("/profile");
});
});