move test

This commit is contained in:
Simon Knott 2024-10-01 16:28:00 +02:00
parent ebcac29ca7
commit 9a0a946ce4
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 5 additions and 19 deletions

View file

@ -46,3 +46,8 @@ test('render inline component with an error if its nested', async ({ mount }) =>
<MyInlineComponent value="Max" /> <MyInlineComponent value="Max" />
</DefaultChildren>)).rejects.toThrow('Component "MyInlineComponent" cannot be mounted.'); </DefaultChildren>)).rejects.toThrow('Component "MyInlineComponent" cannot be mounted.');
}); });
test('render Fragment shorthand notation', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32853' } }, async ({ mount }) => {
const component = await mount(<>Learn React</>);
await expect(component).toContainText('Learn React');
});

View file

@ -596,22 +596,3 @@ test('should allow import from shared file', async ({ runInlineTest }) => {
expect(result.exitCode).toBe(0); expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1); expect(result.passed).toBe(1);
}); });
test('should render fragment at root', async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright.config.ts': playwrightCtConfigText,
'playwright/index.html': `<script type="module" src="./index.ts"></script>`,
'playwright/index.ts': ``,
'src/component.spec.tsx': `
import { test, expect } from '@playwright/experimental-ct-react';
test('should work', async ({ mount, page }) => {
const component = await mount(<>Learn React</>);
await expect(component).toContainText('Learn React');
});
`
});
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
});