diff --git a/tests/components/ct-solid/playwright.config.ts b/tests/components/ct-solid/playwright.config.ts
index 891aeb6e04..09035ac5cb 100644
--- a/tests/components/ct-solid/playwright.config.ts
+++ b/tests/components/ct-solid/playwright.config.ts
@@ -15,14 +15,22 @@
*/
import { type PlaywrightTestConfig, devices } from '@playwright/experimental-ct-solid';
+import { resolve } from 'path';
const config: PlaywrightTestConfig = {
- testDir: 'src',
+ testDir: 'tests',
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: 'html',
use: {
trace: 'on-first-retry',
+ ctViteConfig: {
+ resolve: {
+ alias: {
+ '@': resolve(__dirname, './src'),
+ }
+ }
+ }
},
projects: [
{
diff --git a/tests/components/ct-solid/src/tests.spec.tsx b/tests/components/ct-solid/src/tests.spec.tsx
deleted file mode 100644
index b6876e7225..0000000000
--- a/tests/components/ct-solid/src/tests.spec.tsx
+++ /dev/null
@@ -1,169 +0,0 @@
-import { test, expect } from '@playwright/experimental-ct-solid';
-import App from './App';
-import Button from './components/Button';
-import Counter from './components/Counter';
-import DefaultChildren from './components/DefaultChildren';
-import MultipleChildren from './components/MultipleChildren';
-import MultiRoot from './components/MultiRoot';
-import EmptyFragment from './components/EmptyFragment';
-import type { HooksConfig } from '../playwright';
-
-test.use({ viewport: { width: 500, height: 500 } });
-
-test('render props', async ({ mount }) => {
- const component = await mount();
- await expect(component).toContainText('Submit');
-});
-
-test('render attributes', async ({ mount }) => {
- const component = await mount()
- await expect(component).toHaveClass('primary');
-});
-
-test('update props without remounting', async ({ mount }) => {
- const component = await mount()
- await expect(component.getByTestId('props')).toContainText('9001')
-
- await component.update()
- await expect(component).not.toContainText('9001')
- await expect(component.getByTestId('props')).toContainText('1337')
-
- /**
- * Ideally toContainText('2') should be toContainText('1')
- * However it seems impossible to update the props, slots or events of a rendered component
- */
- await expect(component.getByTestId('remount-count')).toContainText('2')
-});
-
-test('update slots without remounting', async ({ mount }) => {
- const component = await mount(Default Slot)
- await expect(component).toContainText('Default Slot')
-
- await component.update(Test Slot)
- await expect(component).not.toContainText('Default Slot')
- await expect(component).toContainText('Test Slot')
-
- /**
- * Ideally toContainText('2') should be toContainText('1')
- * However it seems impossible to update the props, slots or events of a rendered component
- */
- await expect(component.getByTestId('remount-count')).toContainText('2')
-});
-
-test('update callbacks without remounting', async ({ mount }) => {
- const component = await mount()
-
- const messages: string[] = []
- await component.update( {
- messages.push(message)
- }} />)
- await component.click();
- expect(messages).toEqual(['hello'])
-
- /**
- * Ideally toContainText('2') should be toContainText('1')
- * However it seems impossible to update the props, slots or events of a rendered component
- */
- await expect(component.getByTestId('remount-count')).toContainText('2')
-});
-
-test('execute callback when the button is clicked', async ({ mount }) => {
- const messages: string[] = [];
- const component = await mount(
-