mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-28 23:01:37 +00:00
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { readFileSync } from 'node:fs'
|
|
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const source = readFileSync(new URL('./App.vue', import.meta.url), 'utf8')
|
|
|
|
describe('browser development preview contract', () => {
|
|
it('starts unlocked while preserving an explicit lock screen preview', () => {
|
|
expect(source).toContain(
|
|
"developmentParameters.has('lockScreenPreview')",
|
|
)
|
|
expect(source).toContain(
|
|
': !isDevelopment || developmentLockScreenPreview',
|
|
)
|
|
expect(source).toContain("developmentParameters.has('setupPreview')")
|
|
})
|
|
|
|
it('loads authenticated app data without replacing direct app routes', () => {
|
|
expect(source).toContain(
|
|
"if (isLocked.value || setupRequired.value) void router.replace('/')",
|
|
)
|
|
expect(source).toContain('else loadUnlockedPhoneData()')
|
|
})
|
|
|
|
it('keeps hairlines at one rendered device pixel through phone zoom', () => {
|
|
expect(source).toContain(
|
|
'...getHairlinePixelStyle(phoneZoom.value, browserDevicePixelRatio.value)',
|
|
)
|
|
expect(source).toContain(':device-pixel-ratio="browserDevicePixelRatio"')
|
|
})
|
|
})
|