shineout
Version:
A components library for React
32 lines (31 loc) • 2 kB
TypeScript
import React from 'react';
export declare function classTest(element: Element, className: string, bool?: boolean): void;
export declare function snapshotTest(component: JSX.Element, testName?: string): void;
export declare function snapshotTestByClick(component: JSX.Element, testName: string | undefined, wrapper: string): void;
export declare function attributesTest(element: Element, attr: string, content: string): void;
export declare function hasAttributesTest(element: Element, attr: string, bool?: boolean): void;
export declare function componentsClassTest(components: NodeListOf<Element>, bool: boolean, componentClassName: string, excludes?: string[]): void;
export declare function textContentTest(element: Element, text: string | null | undefined): void;
export declare function classContentTest(element: Element, name: string, bool?: boolean): void;
export declare function styleTest(element: Element, style: string): void;
export declare function styleContentTest(element: Element, name: string, bool?: boolean): void;
export interface StyleProps {
[key: string]: string;
}
interface BaseTestProps {
style?: StyleProps;
className?: string;
children?: React.ReactNode;
data?: any;
}
export type ReactComponentType = React.ComponentType<BaseTestProps>;
export declare function baseTest(Component: ReactComponentType | JSX.Element, selector: string, styleV?: StyleProps, styleRender?: string, className?: string, data?: any): void;
export declare function childrenTest(Component: React.ComponentType<BaseTestProps>, selector: string): void;
export declare function inputValueTest(element: Element, value: string): void;
export declare function displayTest(Component: React.FC, displayName: string): void;
export declare const delay: (time: number) => Promise<void>;
type classNamesMapType = {
[key: string]: string;
};
export declare const createClassName: (componentsName: string, originClasses: string[], originItemClasses: string[]) => classNamesMapType;
export {};