diff --git a/apps/app/src/pages-v2/dashboard.vue b/apps/app/src/pages-v2/dashboard.vue index 4a82305b..1724a8f8 100644 --- a/apps/app/src/pages-v2/dashboard.vue +++ b/apps/app/src/pages-v2/dashboard.vue @@ -1,9 +1,17 @@ diff --git a/apps/app/tests/playwright-ct/v2/appshell-boot.spec.ts b/apps/app/tests/playwright-ct/v2/appshell-boot.spec.ts new file mode 100644 index 00000000..66ef026c --- /dev/null +++ b/apps/app/tests/playwright-ct/v2/appshell-boot.spec.ts @@ -0,0 +1,19 @@ +import { expect, test } from '@playwright/experimental-ct-vue' +import AppShellV2 from '@/layouts/components/AppShellV2.vue' + +// Pinia is set up globally by playwright/index.ts's beforeMount hook +// (createPinia per test). We do NOT use @pinia/testing's +// createTestingPinia here: it requires Vitest's `vi.fn`, which is +// absent in Playwright's Node runtime. See playwright/index.ts §Pinia. + +test('AppShellV2 mounts and renders content in the CT runner', async ({ mount, page }) => { + await mount(AppShellV2, { + slots: { default: '
v2 foundation OK
' }, + }) + + // `data-testid="appshell-v2"` is on the component's own root element, + // so we query the page rather than the component locator (which only + // matches descendants of the root, not the root itself in CT). + await expect(page.getByTestId('appshell-v2')).toBeVisible() + await expect(page.getByTestId('v2-dashboard')).toContainText('v2 foundation OK') +})