Files
sky_phone/frontend/src/components/CustomAppFrame.contract.test.ts
T
Leon.Schmidt 30559048fd FIX - complete LB custom app compatibility (#11)
* FIX - preserve LB custom app lifecycle

* FIX - reset LB export aliases before startup

* FIX - report competing custom app providers

* FIX - identify LB app frames as live NUI

* FIX - complete LB custom app compatibility

* FIX - provide LB PicChat runtime exports

* FIX - route LB PicChat through Sky Phone

* FIX - return cached LB equipped phone number

* FIX - harden PicChat compatibility migration

* ENH - complete modular phone provider and Creator APIs

* DOC - document the Sky Phone Creator API

---------

Co-authored-by: DerEchteAlec <bycraky@gmail.com>
Co-authored-by: DerEchteAlec <alec.schitzkat@luwan.io>
2026-08-20 18:19:16 +02:00

29 lines
958 B
TypeScript

import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
const frame = readFileSync(
new URL('./CustomAppFrame.vue', import.meta.url),
'utf8',
)
const appTypes = readFileSync(
new URL('../types/apps.ts', import.meta.url),
'utf8',
)
describe('Custom app frame context permissions', () => {
it('only exposes locale and theme context when their capabilities are granted', () => {
expect(frame).toContain("capabilities.includes('theme.read')")
expect(frame).toContain("capabilities.includes('locale.read')")
expect(frame).toMatch(
/capabilities\.includes\('theme\.read'\)[\s\S]*colorScheme/,
)
expect(frame).toMatch(
/capabilities\.includes\('locale\.read'\)[\s\S]*language:[\s\S]*locale:/,
)
expect(appTypes).toContain("colorScheme?: 'dark' | 'light'")
expect(appTypes).toContain('language?: string')
expect(appTypes).toContain('locale?: Record<string, unknown>')
})
})