layout.test.js
867 bytes
| 1 | import { readFileSync } from "node:fs"; |
|---|---|
| 2 | import { describe, expect, it } from "vitest"; |
| 3 | |
| 4 | describe("responsive layout", () => { |
| 5 | it("keeps structured repository navigation without forcing a desktop canvas", () => { |
| 6 | const css = readFileSync(new URL("../src/public/styles.css", import.meta.url), "utf8"); |
| 7 | expect(css).not.toContain("min-width: 1024px"); |
| 8 | expect(css).toContain("@media (max-width: 900px)"); |
| 9 | expect(css).toContain("@media (max-width: 640px)"); |
| 10 | expect(css).toMatch(/repo-tabs-inner\s*\{[^}]*display: flex/); |
| 11 | expect(css).toMatch(/latest-commit\s*\{[^}]*grid-template-columns:/); |
| 12 | expect(css).toMatch(/markdown-body\s*\{[^}]*padding:/); |
| 13 | expect(css).toContain(".repo-icon-branch { width: 14px; height: 14px; max-width: 14px; max-height: 14px; }"); |
| 14 | expect(css).not.toMatch(/code-toolbar svg\s*\{[^}]*width:\s*100%/); |
| 15 | }); |
| 16 | }); |
| 17 | |