feat(ct): mount generic type required when specified (#15591)

This commit is contained in:
sand4rt 2022-07-13 17:41:20 +02:00 committed by GitHub
parent 83e3dbb1bb
commit 82fb68fdde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 7 deletions

View File

@ -34,9 +34,15 @@ export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
}
};
export interface ComponentFixtures {
mount<Props = { [key: string]: any }>(component: any, options?: {
props?: Props,
interface ComponentFixtures {
mount(component: any, options?: {
props?: { [key: string]: any },
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig: any,
}): Promise<Locator>;
mount<Props>(component: any, options: {
props: Props,
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig: any,

View File

@ -36,8 +36,14 @@ export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
export interface ComponentFixtures {
mount(component: JSX.Element): Promise<Locator>;
mount<Props = { [key: string]: any }>(component: any, options?: {
props?: Props,
mount(component: any, options?: {
props?: { [key: string]: any },
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig?: any,
}): Promise<Locator>;
mount<Props>(component: any, options: {
props: Props,
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig?: any,

View File

@ -36,8 +36,14 @@ export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
export interface ComponentFixtures {
mount(component: JSX.Element): Promise<Locator>;
mount<Props = { [key: string]: any }>(component: any, options?: {
props?: Props,
mount(component: any, options?: {
props?: { [key: string]: any },
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig: any,
}): Promise<Locator>;
mount<Props>(component: any, options: {
props: Props,
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig: any,