fix: serve favicon.svg as the app favicon via root links export (#854)

This commit is contained in:
Hiep Le
2026-05-28 12:48:30 +07:00
committed by GitHub
parent f2320accc6
commit 26e5f45005
3 changed files with 21 additions and 1 deletions
+15 -1
View File
@@ -3,7 +3,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createRoutesStub } from "react-router"; import { createRoutesStub } from "react-router";
import { beforeEach, describe, expect, it, vi } from "vitest"; import { beforeEach, describe, expect, it, vi } from "vitest";
import { http, HttpResponse } from "msw"; import { http, HttpResponse } from "msw";
import App from "#/root"; import App, { links } from "#/root";
import { server } from "#/mocks/node"; import { server } from "#/mocks/node";
import { __resetActiveStoreForTests } from "#/api/backend-registry/active-store"; import { __resetActiveStoreForTests } from "#/api/backend-registry/active-store";
import { ActiveBackendProvider } from "#/contexts/active-backend-context"; import { ActiveBackendProvider } from "#/contexts/active-backend-context";
@@ -142,3 +142,17 @@ describe("App root agent-server availability guard", () => {
).not.toBeInTheDocument(); ).not.toBeInTheDocument();
}); });
}); });
describe("App root document links", () => {
it("declares the SVG favicon used by the browser tab", () => {
// Act
const documentLinks = links();
// Assert
expect(documentLinks).toContainEqual({
rel: "icon",
type: "image/svg+xml",
href: "/favicon.svg",
});
});
});
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.3 KiB

+5
View File
@@ -1,5 +1,6 @@
import { import {
Links, Links,
LinksFunction,
Meta, Meta,
MetaFunction, MetaFunction,
Outlet, Outlet,
@@ -94,6 +95,10 @@ function MissingAgentServerScreen() {
); );
} }
export const links: LinksFunction = () => [
{ rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
];
export const meta: MetaFunction = () => [ export const meta: MetaFunction = () => [
{ title: "OpenHands" }, { title: "OpenHands" },
{ name: "description", content: "Let's Start Building!" }, { name: "description", content: "Let's Start Building!" },