mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-12-06 07:34:00 +00:00
Install @perfect-design/ui 0.3.10 with the workbench style pack, IBM Plex faces and the inline theme boot script. The app shell uses AppHeader, AppShell and SidebarNav. Shared formatters, severity tones and icon data replace the per-view copies. A test checks that main.css scans only the library directories the app imports.
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
// @vitest-environment node
|
|
import { describe, expect, it } from 'vitest'
|
|
import css from './main.css?raw'
|
|
import { librarySources } from '../../scripts/library-sources.mjs'
|
|
|
|
const root = new URL('../..', import.meta.url).pathname
|
|
|
|
describe('main.css', () => {
|
|
it('imports the library theme and the workbench pack', () => {
|
|
expect(css).toContain('@import "@perfect-design/ui/theme.css"')
|
|
expect(css).toContain('@import "@perfect-design/ui/packs/workbench.css"')
|
|
})
|
|
|
|
it('scans only the library directories the app imports (run `pnpm sources` after changing imports)', () => {
|
|
const declared = css.split('\n').filter((line: string) => line.startsWith('@source '))
|
|
expect(declared).toEqual(librarySources(root))
|
|
expect(css).not.toMatch(/@source "[^"]*\/dist"/)
|
|
})
|
|
|
|
it('loads the Plex faces as Latin woff2 only', () => {
|
|
const urls = [...css.matchAll(/url\("([^"]+)"\)/g)].map((m) => m[1])
|
|
expect(urls.length).toBe(4)
|
|
for (const url of urls) expect(url).toMatch(/-latin-\d{3}-normal\.woff2$/)
|
|
})
|
|
|
|
it('shares one header height token with the scroll offset', () => {
|
|
expect(css).toMatch(/--header-h:/)
|
|
expect(css).toMatch(/scroll-padding-top:\s*calc\(var\(--header-h\)/)
|
|
})
|
|
})
|