test(ct): test react native events (#14079)

This commit is contained in:
Pavel Feldman 2022-05-10 13:01:06 -08:00 committed by GitHub
parent ba0cfaeb2d
commit a62034a6d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { test, expect } from '@playwright/experimental-ct-vue'
import { test, expect } from '@playwright/experimental-ct-react'
import { DelayedData } from './DelayedData';
test('toHaveText works on delayed data', async ({ mount }) => {

View 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,
}));
});

View File

@ -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 { serverFixtures } from '../../../../tests/config/serverFixtures';