allow the example to add params to the testing context
This commit is contained in:
parent
d61c5808bd
commit
9fe1c4b5ec
@ -323,6 +323,7 @@ function parseExampleImport(
|
|||||||
render: {
|
render: {
|
||||||
component: exampleValue as FunctionComponent,
|
component: exampleValue as FunctionComponent,
|
||||||
props: {},
|
props: {},
|
||||||
|
contextProps: {},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -367,19 +368,22 @@ export interface Group {
|
|||||||
list: ComponentItem[];
|
list: ComponentItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentItem {
|
export interface ComponentItem<Props extends object = {}> {
|
||||||
name: string;
|
name: string;
|
||||||
examples: ExampleItem[];
|
examples: ExampleItem<Props>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExampleItem {
|
export type ExampleItemSetup<Props extends object = {}> = {
|
||||||
|
component: FunctionalComponent<Props>;
|
||||||
|
props: Props;
|
||||||
|
contextProps: object;
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface ExampleItem<Props extends object = {}> {
|
||||||
group: string;
|
group: string;
|
||||||
component: string;
|
component: string;
|
||||||
name: string;
|
name: string;
|
||||||
render: {
|
render: ExampleItemSetup<Props>;
|
||||||
component: FunctionalComponent;
|
|
||||||
props: object;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ComponentOrFolder = MaybeComponent | MaybeFolder;
|
type ComponentOrFolder = MaybeComponent | MaybeFolder;
|
||||||
|
Loading…
Reference in New Issue
Block a user