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') })