Skip to content

Commit 3b36a79

Browse files
test(client-runtime): drop favicon refresh test that only exercises the atom registry
AI-assisted; verified with the tests and tools listed above.
1 parent e6ef8c8 commit 3b36a79

1 file changed

Lines changed: 0 additions & 42 deletions

File tree

‎packages/client-runtime/src/state/assets.test.ts‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
createAssetEnvironmentAtoms,
3232
createProjectFaviconUrlAtomFamily,
3333
makeRevisionedAssetUrlFamily,
34-
projectFaviconResource,
3534
} from "./assets.ts";
3635

3736
describe("project favicon URL cache", () => {
@@ -65,47 +64,6 @@ describe("project favicon URL cache", () => {
6564
registry.dispose();
6665
}
6766
});
68-
69-
it("resolves the icon again when its resource's URL query is refreshed", () => {
70-
const registry = AtomRegistry.make();
71-
const answers = ["/api/assets/token/project-favicon-missing", "/api/assets/token/v1-icon.svg"];
72-
const query = Atom.family((key: string) =>
73-
Atom.make(() =>
74-
AsyncResult.success({ expiresAt: 4_000_000_000_000, relativeUrl: answers.shift()! }),
75-
).pipe(Atom.withLabel(key)),
76-
);
77-
const createUrl = (target: {
78-
readonly environmentId: EnvironmentId;
79-
readonly input: { readonly resource: AssetResource };
80-
}) => query(JSON.stringify([target.environmentId, target.input.resource]));
81-
const favicon = createProjectFaviconUrlAtomFamily({
82-
createUrl,
83-
preparedConnection: () => Atom.make(Option.some({ httpBaseUrl: "https://remote.test" })),
84-
});
85-
const target = {
86-
environmentId: EnvironmentId.make("remote"),
87-
cwd: "/workspace",
88-
faviconPath: "icon.svg",
89-
};
90-
const unmount = registry.mount(favicon(target));
91-
try {
92-
expect(registry.get(favicon(target))).toBe(
93-
"https://remote.test/api/assets/token/project-favicon-missing",
94-
);
95-
registry.refresh(
96-
createUrl({
97-
environmentId: target.environmentId,
98-
input: { resource: projectFaviconResource(target.cwd, target.faviconPath) },
99-
}),
100-
);
101-
expect(registry.get(favicon(target))).toBe(
102-
"https://remote.test/api/assets/token/v1-icon.svg",
103-
);
104-
} finally {
105-
unmount();
106-
registry.dispose();
107-
}
108-
});
10967
});
11068

11169
/**

0 commit comments

Comments
 (0)