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
11 changes: 4 additions & 7 deletions apps/web/src/components/ChatMarkdown.browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,17 @@ it("loads a host image through the page's own route when there is no environment
});

describe("ChatMarkdown favicon privacy", () => {
it("suppresses private link images while preserving public links across updates", async () => {
it("draws link icons in-app and never requests a remote favicon", async () => {
setup();
const markdown = (url: string) => <ChatMarkdown cwd="/tmp/project" text={`[Link](${url})`} />;
await using screen = await render(markdown("https://example.com"));
const { container, rerender } = screen;
expect([...container.querySelectorAll("img")].map((image) => image.src)).toEqual([
"https://www.google.com/s2/favicons?domain=example.com&sz=32",
]);
expect(container.querySelectorAll("img")).toHaveLength(0);
expect(container.querySelector("a svg")).not.toBeNull();
for (const url of ["http://192.168.1.10:8080", "http://localhost:3000", "http://home.arpa"]) {
await rerender(markdown(url));
expect(container.querySelectorAll("img")).toHaveLength(0);
}
await rerender(markdown("https://example.com"));
expect(container.querySelectorAll("img")).toHaveLength(1);
await rerender(markdown("https://github.com/pingdotgg/t3code/pull/1"));
expect(container.querySelectorAll("img")).toHaveLength(0);
expect(container.querySelector("a svg")).not.toBeNull();
Expand Down Expand Up @@ -364,7 +361,7 @@ describe("ChatMarkdown skill chips", () => {
.spyOn(useRightPanelStore.getState(), "openFile")
.mockImplementation(() => {});

await userEvent.click(screen.getByRole("button", { name: "Skill Review. Show details" }));
await userEvent.click(screen.getByRole("button", { name: "Skill, Review. Show details" }));
await expect.element(page.getByText("Reviews the current branch.")).toBeVisible();
await userEvent.click(page.getByRole("button", { name: "View instructions" }));

Expand Down