test(ct): test react native events (#14079)
This commit is contained in:
parent
ba0cfaeb2d
commit
a62034a6d6
|
|
@ -1,4 +1,4 @@
|
||||||
import { test, expect } from '@playwright/experimental-ct-vue'
|
import { test, expect } from '@playwright/experimental-ct-react'
|
||||||
import { DelayedData } from './DelayedData';
|
import { DelayedData } from './DelayedData';
|
||||||
|
|
||||||
test('toHaveText works on delayed data', async ({ mount }) => {
|
test('toHaveText works on delayed data', async ({ mount }) => {
|
||||||
|
|
|
||||||
14
tests/components/ct-react/src/Events.spec.tsx
Normal file
14
tests/components/ct-react/src/Events.spec.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { test, expect } from '@playwright/experimental-ct-react';
|
||||||
|
|
||||||
|
test('should marshall events', async ({ mount }) => {
|
||||||
|
let event: any;
|
||||||
|
const component = await mount(<button onClick={e => event = e }>Submit</button>);
|
||||||
|
await component.click();
|
||||||
|
expect(event).toEqual(expect.objectContaining({
|
||||||
|
type: 'click',
|
||||||
|
pageX: expect.any(Number),
|
||||||
|
pageY: expect.any(Number),
|
||||||
|
ctrlKey: false,
|
||||||
|
isTrusted: true,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { test as _test, expect } from '@playwright/experimental-ct-vue'
|
import { test as _test, expect } from '@playwright/experimental-ct-react'
|
||||||
import { Fetch } from './Fetch';
|
import { Fetch } from './Fetch';
|
||||||
import { serverFixtures } from '../../../../tests/config/serverFixtures';
|
import { serverFixtures } from '../../../../tests/config/serverFixtures';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue