Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/viewer-session-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ function loadViewerSandbox() {
setAttribute: (name: string, value: unknown) => {
attributes.set(name, String(value));
},
// Added in #313 — switchTab toggles aria-selected via removeAttribute
// on the non-active tab buttons. The mock previously only had
// get/setAttribute, so the new hash-routing path threw TypeError.
removeAttribute: (name: string) => {
attributes.delete(name);
},
querySelectorAll: () => [],
};
};
Expand Down Expand Up @@ -118,6 +124,16 @@ function loadViewerSandbox() {
matchMedia: () => ({ matches: false }),
addEventListener: () => {},
},
// Stubbed in #313 — the viewer now calls history.replaceState
// inside updateTabRoute → switchTab to drive the hash-route surface.
// The vm sandbox is otherwise zero-globals so the call would
// throw ReferenceError. No-op is fine for the rendering tests.
history: { replaceState: () => {}, pushState: () => {} },
location: {
hash: "",
pathname: "/",
search: "",
},
localStorage: { getItem: () => null, setItem: () => {} },
fetch: async () => ({ ok: true, json: async () => ({}) }),
WebSocket: function WebSocket() {},
Expand Down