openpencil/tests/e2e/canvas/document-loading.spec.ts
Danila Poyarkov 42225c604a
feat: refresh branding with generated platform icons (#707)
* feat: refresh branding with generated platform icons

Keep the approved mark and optical micro master as the source of truth. Generate web, documentation, and native assets at their owning build boundaries instead of storing raster variants or linking web icons to desktop output.

* fix: refine small brand marks and loading artwork

* feat: adopt blue editing-handle brand mark

* feat: refine teal branding for light and dark themes

* feat: apply ivory tiles across brand surfaces

Use edge-to-edge web tiles with a larger mark and optical micro favicons. Preserve native spacing and platform-owned maskable/touch cropping. Address review feedback on story props, native dimensions, and brand test type checking.

* test: allow cold npm startup in packaging fixture

CI hit Bun's five-second default while running npm pack --dry-run. Give this integration test a scoped 30-second budget without changing production timeouts or other tests.
2026-09-16 11:54:07 +03:00

52 lines
1.8 KiB
TypeScript

import { expect, test, useEditorSetup } from '#tests/e2e/fixtures'
const editor = useEditorSetup('/?test&no-chrome&no-rulers')
test('shows staged and determinate document loading progress in the existing canvas overlay', async () => {
await editor.page.evaluate(() => {
const store = window.openPencil?.getStore?.()
if (!store) throw new Error('OpenPencil store not initialized')
const load = store.preparationController.begin({
kind: 'document-open',
phase: 'resolving-fonts',
subject: 'example.fig'
})
load.update({
phase: 'resolving-fonts',
detail: 'Geist SemiBold',
completed: 7,
total: 12,
unit: 'fonts'
})
})
const loader = editor.page.getByTestId('canvas-loading')
await expect(loader).toBeVisible()
await expect(loader).toHaveAttribute('role', 'status')
await expect(loader).toContainText('Resolving fonts')
await expect(loader).toContainText('Geist SemiBold')
await expect(loader).toContainText('7 of 12')
await expect(loader.getByRole('progressbar')).toHaveAttribute('aria-valuenow', '58')
for (const appearance of ['light', 'dark'] as const) {
await editor.page.evaluate(async (appearance) => {
const path = '/src/app/shell/theme.ts'
const module = await import(path)
module.useAppTheme().setTheme(appearance)
}, appearance)
const mark = loader.locator('img')
await expect(mark).toHaveAttribute('src', '/brand/app-icon.svg')
await expect(mark).toHaveAttribute('alt', '')
await expect(mark).toHaveScreenshot(`loading-brand-${appearance}.png`, {
maxDiffPixels: 0,
threshold: 0.1
})
}
await editor.page.evaluate(() => {
const store = window.openPencil?.getStore?.()
if (!store) return
store.preparationController.dispose()
})
await expect(loader).toBeHidden()
})