mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-08 12:28:46 +03:00
feat(ct): svelte partial update (#23193)
This commit is contained in:
parent
144f8b1495
commit
bb84d42d67
28
packages/playwright-ct-svelte/index.d.ts
vendored
28
packages/playwright-ct-svelte/index.d.ts
vendored
@ -36,30 +36,27 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
type Slot = string | string[];
|
type ComponentSlot = string | string[];
|
||||||
|
type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };
|
||||||
|
type ComponentEvents = Record<string, Function>;
|
||||||
|
|
||||||
export interface MountOptions<
|
export interface MountOptions<HooksConfig extends JsonObject, Component extends SvelteComponent> {
|
||||||
HooksConfig extends JsonObject,
|
|
||||||
Component extends SvelteComponent
|
|
||||||
> {
|
|
||||||
props?: ComponentProps<Component>;
|
props?: ComponentProps<Component>;
|
||||||
slots?: Record<string, Slot> & { default?: Slot };
|
slots?: ComponentSlots;
|
||||||
on?: Record<string, Function>;
|
on?: ComponentEvents;
|
||||||
hooksConfig?: HooksConfig;
|
hooksConfig?: HooksConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MountResult<Component extends SvelteComponent> extends Locator {
|
interface MountResult<Component extends SvelteComponent> extends Locator {
|
||||||
unmount(): Promise<void>;
|
unmount(): Promise<void>;
|
||||||
update(
|
update(options: {
|
||||||
options: Omit<MountOptions<never, Component>, 'hooksConfig' | 'slots'>
|
props?: Partial<ComponentProps<Component>>;
|
||||||
): Promise<void>;
|
on?: Partial<ComponentEvents>;
|
||||||
|
}): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ComponentFixtures {
|
interface ComponentFixtures {
|
||||||
mount<
|
mount<HooksConfig extends JsonObject, Component extends SvelteComponent = SvelteComponent>(
|
||||||
HooksConfig extends JsonObject,
|
|
||||||
Component extends SvelteComponent = SvelteComponent
|
|
||||||
>(
|
|
||||||
component: new (...args: any[]) => Component,
|
component: new (...args: any[]) => Component,
|
||||||
options?: MountOptions<HooksConfig, Component>
|
options?: MountOptions<HooksConfig, Component>
|
||||||
): Promise<MountResult<Component>>;
|
): Promise<MountResult<Component>>;
|
||||||
@ -70,9 +67,6 @@ export const test: TestType<
|
|||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
||||||
>;
|
>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines Playwright config
|
|
||||||
*/
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
||||||
|
2
packages/playwright-ct-svelte/register.d.ts
vendored
2
packages/playwright-ct-svelte/register.d.ts
vendored
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export default function(
|
export default function(
|
||||||
components: { [key: string]: any },
|
components: Record<string, any>,
|
||||||
options?: {
|
options?: {
|
||||||
window?: Window
|
window?: Window
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user