Skip to content

Commit 627497f

Browse files
committed
fix(ui): isolate board mock mode between test files
1 parent 20eda75 commit 627497f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎ui/src/pages/chat/board-session-surface.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { BoardTab } from "../../lib/board/types.ts";
77
import { renderBoardFaceToggle, renderBoardSessionSurface } from "./board-session-surface.ts";
88

99
const containers: HTMLElement[] = [];
10+
let previousUrl = "/";
1011

1112
function createContainer() {
1213
const container = document.createElement("div");
@@ -19,9 +20,12 @@ afterEach(() => {
1920
for (const container of containers.splice(0)) {
2021
container.remove();
2122
}
23+
// UI files share jsdom; leaking mockBoard turns later gateway boards into mocks.
24+
window.history.replaceState({}, "", previousUrl);
2225
});
2326

2427
beforeEach(() => {
28+
previousUrl = `${window.location.pathname}${window.location.search}${window.location.hash}`;
2529
window.history.replaceState({}, "", "/?mockBoard=1");
2630
});
2731

0 commit comments

Comments
 (0)