testeranto
Version:
the AI powered BDD test framework for typescript projects
93 lines (83 loc) • 2.15 kB
text/typescript
/* eslint-disable @typescript-eslint/no-empty-object-type */
/* eslint-disable @typescript-eslint/no-explicit-any */
import ReactDom from "react-dom/client";
import { Ibdd_in, Ibdd_out } from "../../../CoreTypes";
import { IProjectPageViewProps } from "../ProjectPageView";
export type IInput = IProjectPageViewProps;
export type ISelection = {
htmlElement: HTMLElement;
reactElement: React.ReactElement;
domRoot: ReactDom.Root;
};
export type IStore = ISelection;
export type ISubject = {
htmlElement: HTMLElement;
domRoot: ReactDom.Root;
};
export type I = Ibdd_in<
IInput,
ISubject,
ISelection,
IStore,
(s: IStore) => IStore,
(s: IStore) => IStore,
{
hasContainerFluid: () => (s: IStore) => IStore;
hasNavBar: () => (s: IStore) => IStore;
hasNavBarTitle: () => (s: IStore) => IStore;
hasTestTable: () => (s: IStore) => IStore;
rendersTestSuite1: () => (s: IStore) => IStore;
rendersTestSuite2: () => (s: IStore) => IStore;
unhappyPath: () => (s: IStore) => IStore;
takeScreenshot: (name: string) => (s: IStore, pm: any) => Promise<IStore>;
}
>;
export type O = Ibdd_out<
{
Default: [string];
Navigation: [string];
ErrorStates: [string];
},
{
Default: [];
WithError: [];
Navigation: [];
WithErrors: [];
WithLogs: [];
},
{
SwitchToTab: [string];
ClickAiderButton: [];
},
{
RendersNavBar: [];
ShowsErrorCounts: [];
ShowsTestResults: [];
ShowsActiveTab: [string];
ShowsLogs: [];
AiderButtonCopiesCommand: [];
takeScreenshot: [string];
ShowsTypeErrors: [];
ShowsLintErrors: [];
}
>;
export type M = {
givens: {
[K in keyof O["givens"]]: (...args: any[]) => IProjectPageViewProps;
};
whens: {
[K in keyof O["whens"]]: (
...args: any[]
) => (
props: IProjectPageViewProps,
utils: any
) => IProjectPageViewProps & { container?: HTMLElement };
};
thens: {
[K in keyof O["thens"]]: (
...args: any[]
) => (
state: IProjectPageViewProps & { container?: HTMLElement }
) => IProjectPageViewProps & { container?: HTMLElement };
};
};