complete performance and reliability follow-ups
This commit is contained in:
@@ -70,6 +70,19 @@ describe("full app", () => {
|
||||
expect(html).not.toContain('<span data-t="nav.home"></span>');
|
||||
});
|
||||
|
||||
test("home page ships only its active theme stylesheet", async () => {
|
||||
const response = await app.fetch("/");
|
||||
const html = await response.text();
|
||||
const href = html.match(/data-wrnexus-theme href="([^"]+)"/)?.[1];
|
||||
expect(href).toContain("/__wrnexus/theme/dark/");
|
||||
expect(html).not.toContain('href="/__wrnexus/theme.css');
|
||||
const cssResponse = await app.fetch(String(href));
|
||||
expect(cssResponse.status).toBe(200);
|
||||
const css = await cssResponse.text();
|
||||
expect(css.length).toBeLessThan(10_000);
|
||||
expect(css).not.toContain("[data-theme=");
|
||||
});
|
||||
|
||||
test("GET /api/hello returns a translated greeting", async () => {
|
||||
const res = await app.fetch("/api/hello");
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
Reference in New Issue
Block a user