favicon.svg embeds @media (prefers-color-scheme: dark) so the DeepSeek mark turns white under a dark browser scheme; index.html and the install manifest gain a 32x32 PNG fallback (brand blue) for Safari, which cannot render SVG favicons. pwa-manifest.e2e.ts pins the PNG link, both manifest icons, and the dark media query.
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { readFile } from 'node:fs/promises'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { join } from 'node:path'
|
|
import { expect, it } from 'vitest'
|
|
|
|
const DIST_ROOT = fileURLToPath(new URL('../dist', import.meta.url))
|
|
|
|
it('ships install metadata with the built web application', async () => {
|
|
const index = await readFile(join(DIST_ROOT, 'index.html'), 'utf8')
|
|
expect(index).toContain('<link rel="manifest" href="/manifest.webmanifest" />')
|
|
expect(index).toContain('<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />')
|
|
|
|
const manifest: unknown = JSON.parse(await readFile(join(DIST_ROOT, 'manifest.webmanifest'), 'utf8'))
|
|
expect(manifest).toEqual({
|
|
id: '/',
|
|
name: 'DeepSeek Harness',
|
|
short_name: 'DSH',
|
|
start_url: '/',
|
|
scope: '/',
|
|
display: 'fullscreen',
|
|
icons: [
|
|
{
|
|
src: '/favicon-32x32.png',
|
|
sizes: '32x32',
|
|
type: 'image/png',
|
|
purpose: 'any',
|
|
},
|
|
{
|
|
src: '/favicon.svg',
|
|
sizes: 'any',
|
|
type: 'image/svg+xml',
|
|
purpose: 'any',
|
|
},
|
|
],
|
|
})
|
|
})
|
|
|
|
it('ships a favicon that switches to a light mark under dark color scheme', async () => {
|
|
const favicon = await readFile(join(DIST_ROOT, 'favicon.svg'), 'utf8')
|
|
expect(favicon).toContain('@media (prefers-color-scheme: dark)')
|
|
expect(favicon).toMatch(/path\s*{[^}]*fill:\s*#fff/i)
|
|
})
|