File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3+ // eslint-disable-next-line import/no-extraneous-dependencies
34import type { JsonObject } from '@playwright/experimental-ct-core/types/component' ;
45import type { MountOptions } from '@playwright/experimental-ct-react' ;
56
Original file line number Diff line number Diff line change 1- import type { ComponentFixtures } from '@playwright/experimental-ct-react' ;
21import type {
32 Locator ,
43 PageScreenshotOptions ,
@@ -8,6 +7,26 @@ import type {
87 PlaywrightWorkerOptions ,
98 TestFixture ,
109} from '@playwright/test' ;
10+ import type { MountOptions } from '@playwright/experimental-ct-react' ;
11+
12+ type JsonPrimitive = string | number | boolean | null ;
13+ type JsonValue = JsonPrimitive | JsonObject | JsonArray ;
14+ type JsonArray = JsonValue [ ] ;
15+
16+ type JsonObject = { [ Key in string ] ?: JsonValue } ;
17+
18+ interface MountResult extends Locator {
19+ unmount ( ) : Promise < void > ;
20+ update ( component : JSX . Element ) : Promise < void > ;
21+ }
22+
23+ interface ComponentFixtures {
24+ mount < HooksConfig extends JsonObject > (
25+ component : JSX . Element ,
26+ options ?: MountOptions < HooksConfig > ,
27+ style ?: React . CSSProperties | undefined ,
28+ ) : Promise < MountResult > ;
29+ }
1130
1231type PlaywrightTestFixtures = PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures ;
1332type PlaywrightWorkerFixtures = PlaywrightWorkerArgs & PlaywrightWorkerOptions ;
You can’t perform that action at this time.
0 commit comments