Skip to content

Commit adaeff2

Browse files
only21milclaude
andcommitted
test(web): reset favicon mock state in setup()
The hoisted favicon atom was assigned inline in the test body. Move it into setup() and call that first, as the browser-test guidelines ask. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 59a8625 commit adaeff2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎apps/web/src/components/ProjectFavicon.browser.test.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ vi.mock(import("../state/assets"), () => ({
1414
},
1515
}));
1616

17-
it("only activates the favicon resource after removing a custom icon", async () => {
18-
const registry = AtomRegistry.make();
17+
function setup() {
1918
const activeResources = new Set<string>();
2019
state.favicon = Atom.make((get) => {
2120
activeResources.add("favicon");
2221
get.addFinalizer(() => activeResources.delete("favicon"));
2322
return null;
2423
});
24+
return { activeResources };
25+
}
26+
27+
it("only activates the favicon resource after removing a custom icon", async () => {
28+
const { activeResources } = setup();
29+
const registry = AtomRegistry.make();
2530
const project: ProjectFaviconProject = {
2631
environmentId: EnvironmentId.make("test"),
2732
workspaceRoot: "/project",

0 commit comments

Comments
 (0)