mirror of
https://github.com/hanzoai/playwright.git
synced 2026-09-24 17:01:53 +00:00
fix(ct): use receiver-free mount typings (#40424)
This commit is contained in:
@@ -27,8 +27,8 @@ import type { Page as PageImpl } from 'playwright-core/lib/client/page';
|
||||
let boundCallbacksForMount: Function[] = [];
|
||||
|
||||
interface MountResult extends Locator {
|
||||
unmount(locator: Locator): Promise<void>;
|
||||
update(options: Omit<MountOptions, 'hooksConfig'> | string | JsxComponent): Promise<void>;
|
||||
unmount: () => Promise<void>;
|
||||
update: (options: ObjectComponentOptions | JsxComponent) => Promise<void>;
|
||||
}
|
||||
|
||||
type TestFixtures = PlaywrightTestArgs & PlaywrightTestOptions & {
|
||||
|
||||
+4
-4
@@ -23,15 +23,15 @@ export interface MountOptions<HooksConfig> {
|
||||
}
|
||||
|
||||
export interface MountResult extends Locator {
|
||||
unmount(): Promise<void>;
|
||||
update(component: React.JSX.Element): Promise<void>;
|
||||
unmount: () => Promise<void>;
|
||||
update: (component: React.JSX.Element) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface ComponentFixtures {
|
||||
mount<HooksConfig>(
|
||||
mount: <HooksConfig>(
|
||||
component: React.JSX.Element,
|
||||
options?: MountOptions<HooksConfig>
|
||||
): Promise<MountResult>;
|
||||
) => Promise<MountResult>;
|
||||
}
|
||||
|
||||
export const test: TestType<ComponentFixtures>;
|
||||
|
||||
+4
-4
@@ -21,15 +21,15 @@ export interface MountOptions<HooksConfig> {
|
||||
}
|
||||
|
||||
export interface MountResult extends Locator {
|
||||
unmount(): Promise<void>;
|
||||
update(component: JSX.Element): Promise<void>;
|
||||
unmount: () => Promise<void>;
|
||||
update: (component: JSX.Element) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface ComponentFixtures {
|
||||
mount<HooksConfig>(
|
||||
mount: <HooksConfig>(
|
||||
component: JSX.Element,
|
||||
options?: MountOptions<HooksConfig>
|
||||
): Promise<MountResult>;
|
||||
) => Promise<MountResult>;
|
||||
}
|
||||
|
||||
export const test: TestType<ComponentFixtures>;
|
||||
|
||||
+15
-13
@@ -39,28 +39,30 @@ export interface MountOptionsJsx<HooksConfig> {
|
||||
}
|
||||
|
||||
export interface MountResult<Component> extends Locator {
|
||||
unmount(): Promise<void>;
|
||||
update(options: {
|
||||
unmount: () => Promise<void>;
|
||||
update: (options: {
|
||||
props?: Partial<ComponentProps<Component>>;
|
||||
slots?: Partial<ComponentSlots>;
|
||||
on?: Partial<ComponentEvents>;
|
||||
}): Promise<void>;
|
||||
}) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface MountResultJsx extends Locator {
|
||||
unmount(): Promise<void>;
|
||||
update(component: JSX.Element): Promise<void>;
|
||||
unmount: () => Promise<void>;
|
||||
update: (component: JSX.Element) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface ComponentFixtures {
|
||||
mount<HooksConfig>(
|
||||
component: JSX.Element,
|
||||
options?: MountOptionsJsx<HooksConfig>
|
||||
): Promise<MountResultJsx>;
|
||||
mount<HooksConfig, Component = unknown>(
|
||||
component: Component,
|
||||
options?: MountOptions<HooksConfig, Component>
|
||||
): Promise<MountResult<Component>>;
|
||||
mount: {
|
||||
<HooksConfig>(
|
||||
component: JSX.Element,
|
||||
options?: MountOptionsJsx<HooksConfig>
|
||||
): Promise<MountResultJsx>;
|
||||
<HooksConfig, Component = unknown>(
|
||||
component: Component,
|
||||
options?: MountOptions<HooksConfig, Component>
|
||||
): Promise<MountResult<Component>>;
|
||||
};
|
||||
}
|
||||
|
||||
export const test: TestType<ComponentFixtures>;
|
||||
|
||||
Reference in New Issue
Block a user