@ryanbrandt/react-testing-utils 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -24
- package/dist/@types/AbstractMockComponent.d.ts +106 -0
- package/dist/@types/{src/react/MockClassComponentWrapper.d.ts → MockClassComponent.d.ts} +7 -7
- package/dist/@types/{src/react/MockFunctionComponentWrapper.d.ts → MockFunctionComponent.d.ts} +5 -5
- package/dist/@types/index.d.ts +2 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +13 -6
- package/dist/@types/jest/index.d.ts +0 -7
- package/dist/@types/react/AbstractMockComponentWrapper.d.ts +0 -58
- package/dist/@types/react/MockClassComponentWrapper.d.ts +0 -33
- package/dist/@types/react/MockFunctionComponentWrapper.d.ts +0 -33
- package/dist/@types/src/index.d.ts +0 -3
- package/dist/@types/src/jest/index.d.ts +0 -7
- package/dist/@types/src/react/AbstractMockComponentWrapper.d.ts +0 -58
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# react-testing-utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Wrappers and utilities for unit testing React components with Jest and React Testing Library.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -12,38 +12,143 @@ yarn add @ryanbrandt/react-testing-utils
|
|
|
12
12
|
npm install @ryanbrandt/react-testing-utils
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
**
|
|
15
|
+
**Required Peer Dependencies**
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
```json
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@testing-library/dom": ">=8.13.0",
|
|
20
|
+
"@testing-library/jest-dom": ">=5.14.1",
|
|
21
|
+
"@testing-library/react": ">=12.1.2",
|
|
22
|
+
"@testing-library/user-event": ">=14.1.0",
|
|
23
|
+
"jest": ">=28.1.0",
|
|
24
|
+
"jest-environment-jsdom": ">=28.1.0",
|
|
25
|
+
"react": ">=17.0.2",
|
|
26
|
+
"react-dom": ">=17.0.2",
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API
|
|
22
31
|
|
|
23
|
-
###
|
|
32
|
+
### Mocking Function Components
|
|
24
33
|
|
|
25
34
|
```tsx
|
|
26
|
-
jest.mock("path/to/
|
|
27
|
-
const
|
|
35
|
+
jest.mock("path/to/component");
|
|
36
|
+
const mockFunctionComponent = new MockFunctionComponent(MyFunctionComponent);
|
|
37
|
+
```
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
// resolves to Jest.MockedFunction<typeof useMyHook>;
|
|
31
|
-
const mockUseMyHook = JestUtilities.assertAsMockFunction(useMyHook);
|
|
39
|
+
### Mocking Class Components
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
```tsx
|
|
42
|
+
jest.mock("path/to/component");
|
|
43
|
+
const mockClassComponent = new MockClassComponent(MyClassComponent);
|
|
44
|
+
```
|
|
36
45
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
### Methods
|
|
47
|
+
|
|
48
|
+
**Setup**
|
|
49
|
+
|
|
50
|
+
A setup is provided by default as `<div data-testid={MockComponent.DATA_TEST_ID} />` when instantiated.
|
|
51
|
+
|
|
52
|
+
However, if a specific setup is needed, you can define your own. Each mock provided mock setup
|
|
53
|
+
will be wrapped in a div as follows: `<div data-testid={MockComponent.DATA_TEST_ID}>{MockSetup}</div>`
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
// Function
|
|
57
|
+
|
|
58
|
+
mockFunctionComponent.mockReturnValue(<div />);
|
|
59
|
+
mockFunctionComponent.mockImplementation((props) => <div>{children}</div>);
|
|
60
|
+
|
|
61
|
+
// Class
|
|
62
|
+
|
|
63
|
+
mockClassComponent.mockRenderReturnValue(<div />);
|
|
64
|
+
mockClassComponent.mockRenderImplementation((props) => (
|
|
65
|
+
<div>{props.children}</div>
|
|
66
|
+
));
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Getters**
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
it("renders one instance", () => {
|
|
73
|
+
...
|
|
74
|
+
expect(mockComponent.mockRoot).toBeInTheDocument();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("renders many instances", () => {
|
|
78
|
+
expect(mockComponent.mockRoots.length).toBeGreaterThan(1);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Click Interactions**
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
|
|
87
|
+
it("does something when clicked", async () => {
|
|
88
|
+
...
|
|
89
|
+
await mockComponent.click();
|
|
90
|
+
});
|
|
40
91
|
|
|
41
|
-
|
|
42
|
-
|
|
92
|
+
it("does something when an instance is clicked", async () => {
|
|
93
|
+
...
|
|
94
|
+
await mockComponent.clickInstance(1);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Typing Interactions**
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
|
|
103
|
+
it("does something when typed into", async () => {
|
|
104
|
+
...
|
|
105
|
+
await mockComponent.type("Foo");
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("does something when an instance is typed into", async () => {
|
|
109
|
+
...
|
|
110
|
+
await mockComponent.typeInstance("Foo", 1);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Screen Assertions**
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
it("is on the screen", () => {
|
|
119
|
+
...
|
|
120
|
+
mockComponent.assertOnScreen();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("is not on the screen", () => {
|
|
124
|
+
...
|
|
125
|
+
mockComponent.assertNotOnScreen();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Invocation Assertions**
|
|
43
131
|
|
|
44
|
-
|
|
132
|
+
```tsx
|
|
133
|
+
it("is called with what I expect", () => {
|
|
134
|
+
...
|
|
135
|
+
mockComponent.assertCalledWith({
|
|
136
|
+
foo: "bar",
|
|
137
|
+
});
|
|
138
|
+
});
|
|
45
139
|
|
|
46
|
-
|
|
47
|
-
|
|
140
|
+
it("is called with what I expect when I expect it", () => {
|
|
141
|
+
...
|
|
142
|
+
mockComponent.assertNthCalledWith({
|
|
143
|
+
foo: "bar",
|
|
144
|
+
}, 1);
|
|
48
145
|
});
|
|
146
|
+
|
|
147
|
+
it("is last called with what I expect", () => {
|
|
148
|
+
...
|
|
149
|
+
mockComponent.assertLastCalledWith({
|
|
150
|
+
foo: "bar"
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
49
154
|
```
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import "@testing-library/jest-dom";
|
|
3
|
+
/**
|
|
4
|
+
* Abstract base mock component class
|
|
5
|
+
*/
|
|
6
|
+
declare abstract class AbstractMockComponent<T> {
|
|
7
|
+
protected _mock: jest.Mocked<unknown>;
|
|
8
|
+
receivedProps: T;
|
|
9
|
+
/**
|
|
10
|
+
* The data-testid applied to the component mocks
|
|
11
|
+
*/
|
|
12
|
+
DATA_TEST_ID: string;
|
|
13
|
+
constructor();
|
|
14
|
+
private _buildPropsExpectation;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the root element of the mocked component, which will
|
|
17
|
+
* always be a div with this.DATA_TEST_ID applied
|
|
18
|
+
*
|
|
19
|
+
* If more than one instance of the component or no instances of the component
|
|
20
|
+
* are on the screen this method will throw
|
|
21
|
+
*
|
|
22
|
+
* @see mockRoots
|
|
23
|
+
*/
|
|
24
|
+
get mockRoot(): HTMLElement;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves the root elements of all of the mocked component instances, which will
|
|
27
|
+
* always be a div with this.DATA_TEST_ID applied
|
|
28
|
+
*
|
|
29
|
+
* Can be used when one or many instances of the mock component exist on the screen.
|
|
30
|
+
* If no instances exist this method will throw
|
|
31
|
+
*
|
|
32
|
+
* @see mockRoot
|
|
33
|
+
*/
|
|
34
|
+
get mockRoots(): HTMLElement[];
|
|
35
|
+
/**
|
|
36
|
+
* Asserts that the mock component was called with the provided subset of props
|
|
37
|
+
* @param props The subset of props to match against
|
|
38
|
+
*/
|
|
39
|
+
assertCalledWith: (props: Partial<T>) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Asserts that the mock component was last called with the provided subset of props
|
|
42
|
+
* @param props The subset of props to match against
|
|
43
|
+
*/
|
|
44
|
+
assertLastCalledWith: (props: Partial<T>) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Asserts that the mock component was nth called with the provided subset of props
|
|
47
|
+
* @param props The subset of props to match against
|
|
48
|
+
* @param n The render number to check against
|
|
49
|
+
*/
|
|
50
|
+
assertNthCalledWith: (props: Partial<T>, n: number) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Asserts that an instance of the component exists within the document
|
|
53
|
+
* @param allowMultiple Optional boolean to allow for multiple instances
|
|
54
|
+
* of the component to exist. When set false, if more than 1 instance
|
|
55
|
+
* of the component is on the screen this assertion will fail.
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
assertOnScreen: (allowMultiple?: boolean) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Asserts that the component is not currently rendered within the document
|
|
61
|
+
*/
|
|
62
|
+
assertNotOnScreen: () => void;
|
|
63
|
+
/**
|
|
64
|
+
* Clicks the root element defined in the mock component's return value/implementation
|
|
65
|
+
* This method will throw if no or more than a single instance of the mock component
|
|
66
|
+
* exists on the screen
|
|
67
|
+
*
|
|
68
|
+
* @param root The root element to click
|
|
69
|
+
* @default this.mockRoot.firstChild
|
|
70
|
+
*
|
|
71
|
+
* @see clickInstance
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
click: (root?: HTMLElement) => Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Clicks the root element of a specific instance of the mock component as defined in the
|
|
77
|
+
* mock return value/implementation.This method will throw if the provided index is not found.
|
|
78
|
+
*
|
|
79
|
+
* @param instanceIndex The index of the instance which should be clicked
|
|
80
|
+
*
|
|
81
|
+
* @see click
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
clickInstance: (instanceIndex: number) => Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Types into the root element of your mock. This method will throw if the root element
|
|
87
|
+
* does not support typing or if there are none or mulitple instances of the mock on the
|
|
88
|
+
* screen.
|
|
89
|
+
*
|
|
90
|
+
* @param value The value to type
|
|
91
|
+
* @param root The root element to type into
|
|
92
|
+
* @default this.mockRoot.firstChild
|
|
93
|
+
*
|
|
94
|
+
* @see typeInstance
|
|
95
|
+
*/
|
|
96
|
+
type: (value: string, root?: HTMLElement) => Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Types into the root element of a specific instance of the mock component. This method will throw
|
|
99
|
+
* if the root element does not support typing or if the provided instance index is not found.
|
|
100
|
+
*
|
|
101
|
+
* @param value The value to type
|
|
102
|
+
* @param instanceIndex The index of the instance to type into
|
|
103
|
+
*/
|
|
104
|
+
typeInstance: (value: string, instanceIndex: number) => Promise<void>;
|
|
105
|
+
}
|
|
106
|
+
export default AbstractMockComponent;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import "@testing-library/jest-dom";
|
|
3
|
-
import
|
|
3
|
+
import AbstractMockComponent from "./AbstractMockComponent";
|
|
4
4
|
declare type ReactClassComponentWithProps<T> = React.ComponentClass<T>;
|
|
5
5
|
/**
|
|
6
|
-
* A standard mock class component
|
|
6
|
+
* A standard mock class component
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* jest.mock("path/to/my/class/component");
|
|
10
|
-
* const mockMyClassComponent = new
|
|
10
|
+
* const mockMyClassComponent = new MockClassComponent(MyClassComponent);
|
|
11
11
|
*/
|
|
12
|
-
declare class
|
|
13
|
-
protected _mock: jest.
|
|
12
|
+
declare class MockClassComponent<T> extends AbstractMockComponent<T> {
|
|
13
|
+
protected _mock: jest.MockedObject<ReactClassComponentWithProps<T>>;
|
|
14
14
|
constructor(actual: ReactClassComponentWithProps<T>);
|
|
15
15
|
protected _configureMockImplementation: (valueGenerator?: (props: T) => JSX.Element | null) => void;
|
|
16
16
|
/**
|
|
@@ -18,7 +18,7 @@ declare class MockClassComponentWrapper<T> extends AbstractMockComponentWrapper<
|
|
|
18
18
|
*
|
|
19
19
|
* Only should be used when truly necessary
|
|
20
20
|
*/
|
|
21
|
-
get __OVERRIDE__mock(): jest.
|
|
21
|
+
get __OVERRIDE__mock(): jest.MockedObject<ReactClassComponentWithProps<T>>;
|
|
22
22
|
/**
|
|
23
23
|
* Mocks the return value of the render method
|
|
24
24
|
* @param value The value render should return
|
|
@@ -30,4 +30,4 @@ declare class MockClassComponentWrapper<T> extends AbstractMockComponentWrapper<
|
|
|
30
30
|
*/
|
|
31
31
|
mockRenderImplementation: (implementation: (props: T) => JSX.Element | null) => void;
|
|
32
32
|
}
|
|
33
|
-
export default
|
|
33
|
+
export default MockClassComponent;
|
package/dist/@types/{src/react/MockFunctionComponentWrapper.d.ts → MockFunctionComponent.d.ts}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import "@testing-library/jest-dom";
|
|
3
|
-
import
|
|
3
|
+
import AbstractMockComponent from "./AbstractMockComponent";
|
|
4
4
|
declare type ReactFunctionComponentWithProps<T> = React.FunctionComponent<T>;
|
|
5
5
|
/**
|
|
6
|
-
* A standard mock function component
|
|
6
|
+
* A standard mock function component instance
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* jest.mock("path/to/my/function/component");
|
|
10
|
-
* const mockMyFunctionComponent = new
|
|
10
|
+
* const mockMyFunctionComponent = new MockFunctionComponent(MyFunctionComponent);
|
|
11
11
|
*/
|
|
12
|
-
declare class
|
|
12
|
+
declare class MockFunctionComponent<T> extends AbstractMockComponent<T> {
|
|
13
13
|
protected _mock: jest.MockedFunction<ReactFunctionComponentWithProps<T>>;
|
|
14
14
|
constructor(actual: ReactFunctionComponentWithProps<T>);
|
|
15
15
|
protected _configureMockImplementation: (valueGenerator?: (props: T) => JSX.Element | null) => void;
|
|
@@ -30,4 +30,4 @@ declare class MockFunctionComponentWrapper<T> extends AbstractMockComponentWrapp
|
|
|
30
30
|
*/
|
|
31
31
|
mockImplementation: (implementation: (props: T) => JSX.Element | null) => void;
|
|
32
32
|
}
|
|
33
|
-
export default
|
|
33
|
+
export default MockFunctionComponent;
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as MockFunctionComponentWrapper } from "./react/MockFunctionComponentWrapper";
|
|
1
|
+
export { default as MockClassComponentWrapper } from "./MockClassComponent";
|
|
2
|
+
export { default as MockFunctionComponentWrapper } from "./MockFunctionComponent";
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import"@testing-library/jest-dom";import{screen as e}from"@testing-library/react";
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import"@testing-library/jest-dom";import{screen as e}from"@testing-library/react";import o from"@testing-library/user-event";class i{_mock;receivedProps;DATA_TEST_ID;constructor(){this.DATA_TEST_ID=Math.random().toString(36).slice(2)}_buildPropsExpectation=t=>[expect.objectContaining({...t}),expect.anything()];get mockRoot(){return e.getByTestId(this.DATA_TEST_ID)}get mockRoots(){return e.getAllByTestId(this.DATA_TEST_ID)}assertCalledWith=t=>{expect(this._mock).toHaveBeenCalledWith(...this._buildPropsExpectation(t))};assertLastCalledWith=t=>{expect(this._mock).toHaveBeenLastCalledWith(...this._buildPropsExpectation(t))};assertNthCalledWith=(t,e)=>{expect(this._mock).toHaveBeenNthCalledWith(e,...this._buildPropsExpectation(t))};assertOnScreen=(t=!0)=>{t?expect(this.mockRoots.length).toBeGreaterThanOrEqual(1):expect(this.mockRoot).toBeInTheDocument()};assertNotOnScreen=()=>{expect((()=>this.mockRoot)).toThrow()};click=async(t=this.mockRoot.firstChild)=>{await o.click(t)};clickInstance=async t=>{await this.click(this.mockRoots[t].firstChild)};type=async(t,e=this.mockRoot.firstChild)=>{await o.type(e,t)};typeInstance=async(t,e)=>{await this.type(t,this.mockRoots[e].firstChild)}}class s extends i{constructor(t){super(),this._mock=jest.mocked(t),this._configureMockImplementation()}_configureMockImplementation=e=>{this._mock.mockImplementation((o=>(this.receivedProps=o,{render:()=>t("div",{"data-testid":this.DATA_TEST_ID,children:e&&e(o)})})))};get __OVERRIDE__mock(){return this._mock}mockRenderReturnValue=t=>{this._configureMockImplementation((()=>t))};mockRenderImplementation=t=>{this._configureMockImplementation((e=>t(e)))}}class c extends i{constructor(t){super(),this._mock=jest.mocked(t),this._configureMockImplementation()}_configureMockImplementation=e=>{this._mock.mockImplementation((o=>(this.receivedProps=o,t("div",{"data-testid":this.DATA_TEST_ID,children:e&&e(o)}))))};get __OVERRIDE__mock(){return this._mock}mockReturnValue=t=>{this._configureMockImplementation((()=>t))};mockImplementation=t=>{this._configureMockImplementation((e=>t(e)))}}export{s as MockClassComponentWrapper,c as MockFunctionComponentWrapper};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/AbstractMockComponent.tsx","../src/MockClassComponent.tsx","../src/MockFunctionComponent.tsx"],"sourcesContent":[null,null,null],"names":["AbstractMockComponent","_mock","receivedProps","DATA_TEST_ID","constructor","this","Math","random","toString","slice","_buildPropsExpectation","props","expect","objectContaining","anything","mockRoot","screen","getByTestId","mockRoots","getAllByTestId","assertCalledWith","toHaveBeenCalledWith","assertLastCalledWith","toHaveBeenLastCalledWith","assertNthCalledWith","n","toHaveBeenNthCalledWith","assertOnScreen","allowMultiple","length","toBeGreaterThanOrEqual","toBeInTheDocument","assertNotOnScreen","toThrow","click","async","root","firstChild","userEvent","clickInstance","instanceIndex","type","value","typeInstance","MockClassComponent","actual","super","jest","mocked","_configureMockImplementation","valueGenerator","mockImplementation","render","_jsx","children","__OVERRIDE__mock","mockRenderReturnValue","mockRenderImplementation","implementation","MockFunctionComponent","mockReturnValue"],"mappings":"qKAOA,MAAeA,EACHC,MAEVC,cAKAC,aAEAC,cACEC,KAAKF,aAAeG,KAAKC,SAASC,SAAS,IAAIC,MAAM,GAI/CC,uBAA0BC,GAAsB,CACtDC,OAAOC,iBAAiB,IACnBF,IAELC,OAAOE,YAYLC,eACF,OAAOC,EAAOC,YAAYZ,KAAKF,cAY7Be,gBACF,OAAOF,EAAOG,eAAed,KAAKF,cAOpCiB,iBAAoBT,IAClBC,OAAOP,KAAKJ,OAAOoB,wBACdhB,KAAKK,uBAAuBC,KAQnCW,qBAAwBX,IACtBC,OAAOP,KAAKJ,OAAOsB,4BACdlB,KAAKK,uBAAuBC,KASnCa,oBAAsB,CAACb,EAAmBc,KACxCb,OAAOP,KAAKJ,OAAOyB,wBACjBD,KACGpB,KAAKK,uBAAuBC,KAWnCgB,eAAiB,CAACC,GAAgB,KAC5BA,EACFhB,OAAOP,KAAKa,UAAUW,QAAQC,uBAAuB,GAErDlB,OAAOP,KAAKU,UAAUgB,qBAO1BC,kBAAoB,KAClBpB,QAAO,IAAMP,KAAKU,WAAUkB,WAc9BC,MAAQC,MACNC,EAAO/B,KAAKU,SAASsB,oBAEfC,EAAUJ,MAAME,IAYxBG,cAAgBJ,MAAOK,UACfnC,KAAK6B,MAAM7B,KAAKa,UAAUsB,GAAeH,aAcjDI,KAAON,MACLO,EACAN,EAAO/B,KAAKU,SAASsB,oBAEfC,EAAUG,KAAKL,EAAMM,IAU7BC,aAAeR,MACbO,EACAF,WAEMnC,KAAKoC,KACTC,EACArC,KAAKa,UAAUsB,GAAeH,aC7JpC,MAAMO,UAA8B5C,EAGlCI,YAAYyC,GACVC,QACAzC,KAAKJ,MAAQ8C,KAAKC,OAAOH,GAEzBxC,KAAK4C,+BAGGA,6BACRC,IAIA7C,KAAKJ,MAAMkD,oBAAoBxC,IAC7BN,KAAKH,cAAgBS,EAEd,CACLyC,OAAQ,IACNC,uBAAkBhD,KAAKF,aAAYmD,SAChCJ,GAAkBA,EAAevC,UAYxC4C,uBACF,OAAOlD,KAAKJ,MAOduD,sBAAyBd,IACvBrC,KAAK4C,8BAA6B,IAAMP,KAO1Ce,yBACEC,IAEArD,KAAK4C,8BAA8BtC,GAAU+C,EAAe/C,MCpDhE,MAAMgD,UAAiC3D,EAKrCI,YAAYyC,GACVC,QACAzC,KAAKJ,MAAQ8C,KAAKC,OAAOH,GAEzBxC,KAAK4C,+BAGGA,6BACRC,IAEA7C,KAAKJ,MAAMkD,oBAAoBxC,IAC7BN,KAAKH,cAAgBS,EAGnB0C,EAAA,MAAA,CAAA,cAAkBhD,KAAKF,aACpBmD,SAAAJ,GAAkBA,EAAevC,SAWtC4C,uBACF,OAAOlD,KAAKJ,MAOd2D,gBAAmBlB,IACjBrC,KAAK4C,8BAA6B,IAAMP,KAO1CS,mBACEO,IAEArD,KAAK4C,8BAA8BtC,GAAU+C,EAAe/C"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime");require("@testing-library/jest-dom");var e=require("@testing-library/react");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=o(require("@testing-library/user-event"));class s{_mock;receivedProps;DATA_TEST_ID;constructor(){this.DATA_TEST_ID=Math.random().toString(36).slice(2)}_buildPropsExpectation=t=>[expect.objectContaining({...t}),expect.anything()];get mockRoot(){return e.screen.getByTestId(this.DATA_TEST_ID)}get mockRoots(){return e.screen.getAllByTestId(this.DATA_TEST_ID)}assertCalledWith=t=>{expect(this._mock).toHaveBeenCalledWith(...this._buildPropsExpectation(t))};assertLastCalledWith=t=>{expect(this._mock).toHaveBeenLastCalledWith(...this._buildPropsExpectation(t))};assertNthCalledWith=(t,e)=>{expect(this._mock).toHaveBeenNthCalledWith(e,...this._buildPropsExpectation(t))};assertOnScreen=(t=!0)=>{t?expect(this.mockRoots.length).toBeGreaterThanOrEqual(1):expect(this.mockRoot).toBeInTheDocument()};assertNotOnScreen=()=>{expect((()=>this.mockRoot)).toThrow()};click=async(t=this.mockRoot.firstChild)=>{await i.default.click(t)};clickInstance=async t=>{await this.click(this.mockRoots[t].firstChild)};type=async(t,e=this.mockRoot.firstChild)=>{await i.default.type(e,t)};typeInstance=async(t,e)=>{await this.type(t,this.mockRoots[e].firstChild)}}exports.MockClassComponentWrapper=class extends s{constructor(t){super(),this._mock=jest.mocked(t),this._configureMockImplementation()}_configureMockImplementation=e=>{this._mock.mockImplementation((o=>(this.receivedProps=o,{render:()=>t.jsx("div",{"data-testid":this.DATA_TEST_ID,children:e&&e(o)})})))};get __OVERRIDE__mock(){return this._mock}mockRenderReturnValue=t=>{this._configureMockImplementation((()=>t))};mockRenderImplementation=t=>{this._configureMockImplementation((e=>t(e)))}},exports.MockFunctionComponentWrapper=class extends s{constructor(t){super(),this._mock=jest.mocked(t),this._configureMockImplementation()}_configureMockImplementation=e=>{this._mock.mockImplementation((o=>(this.receivedProps=o,t.jsx("div",{"data-testid":this.DATA_TEST_ID,children:e&&e(o)}))))};get __OVERRIDE__mock(){return this._mock}mockReturnValue=t=>{this._configureMockImplementation((()=>t))};mockImplementation=t=>{this._configureMockImplementation((e=>t(e)))}};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/AbstractMockComponent.tsx","../src/MockClassComponent.tsx","../src/MockFunctionComponent.tsx"],"sourcesContent":[null,null,null],"names":["AbstractMockComponent","_mock","receivedProps","DATA_TEST_ID","constructor","this","Math","random","toString","slice","_buildPropsExpectation","props","expect","objectContaining","anything","mockRoot","screen","getByTestId","mockRoots","getAllByTestId","assertCalledWith","toHaveBeenCalledWith","assertLastCalledWith","toHaveBeenLastCalledWith","assertNthCalledWith","n","toHaveBeenNthCalledWith","assertOnScreen","allowMultiple","length","toBeGreaterThanOrEqual","toBeInTheDocument","assertNotOnScreen","toThrow","click","async","root","firstChild","userEvent","clickInstance","instanceIndex","type","value","typeInstance","actual","super","jest","mocked","_configureMockImplementation","valueGenerator","mockImplementation","render","_jsx","children","__OVERRIDE__mock","mockRenderReturnValue","mockRenderImplementation","implementation","mockReturnValue"],"mappings":"4SAOA,MAAeA,EACHC,MAEVC,cAKAC,aAEAC,cACEC,KAAKF,aAAeG,KAAKC,SAASC,SAAS,IAAIC,MAAM,GAI/CC,uBAA0BC,GAAsB,CACtDC,OAAOC,iBAAiB,IACnBF,IAELC,OAAOE,YAYLC,eACF,OAAOC,SAAOC,YAAYZ,KAAKF,cAY7Be,gBACF,OAAOF,SAAOG,eAAed,KAAKF,cAOpCiB,iBAAoBT,IAClBC,OAAOP,KAAKJ,OAAOoB,wBACdhB,KAAKK,uBAAuBC,KAQnCW,qBAAwBX,IACtBC,OAAOP,KAAKJ,OAAOsB,4BACdlB,KAAKK,uBAAuBC,KASnCa,oBAAsB,CAACb,EAAmBc,KACxCb,OAAOP,KAAKJ,OAAOyB,wBACjBD,KACGpB,KAAKK,uBAAuBC,KAWnCgB,eAAiB,CAACC,GAAgB,KAC5BA,EACFhB,OAAOP,KAAKa,UAAUW,QAAQC,uBAAuB,GAErDlB,OAAOP,KAAKU,UAAUgB,qBAO1BC,kBAAoB,KAClBpB,QAAO,IAAMP,KAAKU,WAAUkB,WAc9BC,MAAQC,MACNC,EAAO/B,KAAKU,SAASsB,oBAEfC,EAAS,QAACJ,MAAME,IAYxBG,cAAgBJ,MAAOK,UACfnC,KAAK6B,MAAM7B,KAAKa,UAAUsB,GAAeH,aAcjDI,KAAON,MACLO,EACAN,EAAO/B,KAAKU,SAASsB,oBAEfC,UAAUG,KAAKL,EAAMM,IAU7BC,aAAeR,MACbO,EACAF,WAEMnC,KAAKoC,KACTC,EACArC,KAAKa,UAAUsB,GAAeH,+CC7JpC,cAAoCrC,EAGlCI,YAAYwC,GACVC,QACAxC,KAAKJ,MAAQ6C,KAAKC,OAAOH,GAEzBvC,KAAK2C,+BAGGA,6BACRC,IAIA5C,KAAKJ,MAAMiD,oBAAoBvC,IAC7BN,KAAKH,cAAgBS,EAEd,CACLwC,OAAQ,IACNC,2BAAkB/C,KAAKF,aAAYkD,SAChCJ,GAAkBA,EAAetC,UAYxC2C,uBACF,OAAOjD,KAAKJ,MAOdsD,sBAAyBb,IACvBrC,KAAK2C,8BAA6B,IAAMN,KAO1Cc,yBACEC,IAEApD,KAAK2C,8BAA8BrC,GAAU8C,EAAe9C,4CCpDhE,cAAuCX,EAKrCI,YAAYwC,GACVC,QACAxC,KAAKJ,MAAQ6C,KAAKC,OAAOH,GAEzBvC,KAAK2C,+BAGGA,6BACRC,IAEA5C,KAAKJ,MAAMiD,oBAAoBvC,IAC7BN,KAAKH,cAAgBS,EAGnByC,MAAA,MAAA,CAAA,cAAkB/C,KAAKF,aACpBkD,SAAAJ,GAAkBA,EAAetC,SAWtC2C,uBACF,OAAOjD,KAAKJ,MAOdyD,gBAAmBhB,IACjBrC,KAAK2C,8BAA6B,IAAMN,KAO1CQ,mBACEO,IAEApD,KAAK2C,8BAA8BrC,GAAU8C,EAAe9C"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanbrandt/react-testing-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"repository": "https://github.com/ryanbrandt/react-testing-utils",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Jest/React/RTL component unit testing utilities",
|
|
6
6
|
"author": "Ryan Brandt",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.esm.js",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
22
22
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
23
23
|
"@rollup/plugin-typescript": "^8.3.2",
|
|
24
|
+
"@testing-library/dom": "^8.13.0",
|
|
24
25
|
"@testing-library/jest-dom": "^5.16.4",
|
|
25
26
|
"@testing-library/react": "^13.0.1",
|
|
26
27
|
"@testing-library/user-event": "^14.1.0",
|
|
27
|
-
"@types/jest": "^27.
|
|
28
|
+
"@types/jest": "^27.5.1",
|
|
28
29
|
"@types/node": "^17.0.23",
|
|
29
30
|
"@types/react": "^18.0.1",
|
|
30
31
|
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
|
@@ -34,22 +35,28 @@
|
|
|
34
35
|
"eslint-config-prettier": "^8.5.0",
|
|
35
36
|
"eslint-import-resolver-typescript": "^2.7.1",
|
|
36
37
|
"eslint-plugin-import": "^2.26.0",
|
|
37
|
-
"jest": "
|
|
38
|
+
"jest": "28.1.0",
|
|
39
|
+
"jest-environment-jsdom": "^28.1.0",
|
|
38
40
|
"prettier": "^2.6.2",
|
|
39
41
|
"react": "^18.0.0",
|
|
40
42
|
"react-dom": "^18.0.0",
|
|
41
43
|
"rollup": "^2.73.0",
|
|
42
44
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
43
45
|
"rollup-plugin-terser": "^7.0.2",
|
|
44
|
-
"ts-jest": "^
|
|
46
|
+
"ts-jest": "^28.0.2",
|
|
47
|
+
"ts-node": "^10.8.0",
|
|
48
|
+
"tslib": "^2.4.0",
|
|
45
49
|
"ttypescript": "^1.5.13",
|
|
46
50
|
"typescript": "^4.6.3",
|
|
47
51
|
"typescript-transform-paths": "^3.3.1"
|
|
48
52
|
},
|
|
49
53
|
"peerDependencies": {
|
|
54
|
+
"@testing-library/dom": ">=8.13.0",
|
|
50
55
|
"@testing-library/jest-dom": ">=5.14.1",
|
|
51
56
|
"@testing-library/react": ">=12.1.2",
|
|
52
|
-
"
|
|
57
|
+
"@testing-library/user-event": ">=14.1.0",
|
|
58
|
+
"jest": ">=28.1.0",
|
|
59
|
+
"jest-environment-jsdom": ">=28.1.0",
|
|
53
60
|
"react": ">=17.0.2",
|
|
54
61
|
"react-dom": ">=17.0.2"
|
|
55
62
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
declare type AnyFunction = (...args: any[]) => any;
|
|
3
|
-
declare class JestUtilities {
|
|
4
|
-
static assertAsMockFunction: <T extends AnyFunction>(actual: T) => jest.MockedFunction<T>;
|
|
5
|
-
static assertAsMockClass: <T extends jest.Constructable>(actual: T) => jest.MockedClass<T>;
|
|
6
|
-
}
|
|
7
|
-
export default JestUtilities;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import "@testing-library/jest-dom";
|
|
3
|
-
/**
|
|
4
|
-
* Abstract base mock component wrapper class
|
|
5
|
-
*/
|
|
6
|
-
declare abstract class AbstractMockComponentWrapper<T> {
|
|
7
|
-
protected _mock: jest.Mocked<unknown>;
|
|
8
|
-
receivedProps: T;
|
|
9
|
-
/**
|
|
10
|
-
* The data-testid applied to the component mocks
|
|
11
|
-
*/
|
|
12
|
-
DATA_TEST_ID: string;
|
|
13
|
-
constructor();
|
|
14
|
-
private _buildPropsExpectation;
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves the root element of the mocked component, which will
|
|
17
|
-
* always be a div with the component data-testid applied
|
|
18
|
-
*
|
|
19
|
-
* Should only be used when one instance of the mock component is on the screen
|
|
20
|
-
*/
|
|
21
|
-
get mockRoot(): HTMLElement;
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves the root elements of all of the mocked component instances, which will
|
|
24
|
-
* always be a div with the component data-testid applied
|
|
25
|
-
*
|
|
26
|
-
* Can be used when multiple instances of the mock component are on the screen
|
|
27
|
-
*/
|
|
28
|
-
get mockRoots(): HTMLElement[];
|
|
29
|
-
/**
|
|
30
|
-
* Asserts that the mock component was called with the provided subset of props
|
|
31
|
-
* @param props The subset of props to match against
|
|
32
|
-
*/
|
|
33
|
-
assertCalledWith: (props: Partial<T>) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Asserts that the mock component was last called with the provided subset of props
|
|
36
|
-
* @param props The subset of props to match against
|
|
37
|
-
*/
|
|
38
|
-
assertLastCalledWith: (props: Partial<T>) => void;
|
|
39
|
-
/**
|
|
40
|
-
* Asserts that the mock component was nth called with the provided subset of props
|
|
41
|
-
* @param props The subset of props to match against
|
|
42
|
-
* @param n The render number to check against
|
|
43
|
-
*/
|
|
44
|
-
assertNthCalledWith: (props: Partial<T>, n: number) => void;
|
|
45
|
-
/**
|
|
46
|
-
* Asserts that an instance of the component exists within the document
|
|
47
|
-
* @param allowMultiple Optional boolean to allow for multiple instances
|
|
48
|
-
* of the component to exist. When set false, if more than 1 instance
|
|
49
|
-
* of the component is on the screen this assertion will fail.
|
|
50
|
-
* @default true
|
|
51
|
-
*/
|
|
52
|
-
assertOnScreen: (allowMultiple?: boolean) => void;
|
|
53
|
-
/**
|
|
54
|
-
* Asserts that the component is not currently rendered within the document
|
|
55
|
-
*/
|
|
56
|
-
assertNotOnScreen: () => void;
|
|
57
|
-
}
|
|
58
|
-
export default AbstractMockComponentWrapper;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import "@testing-library/jest-dom";
|
|
3
|
-
import AbstractMockComponentWrapper from "./AbstractMockComponentWrapper";
|
|
4
|
-
declare type ReactClassComponentWithProps<T> = React.ComponentClass<T>;
|
|
5
|
-
/**
|
|
6
|
-
* A standard mock class component wrapper
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* jest.mock("path/to/my/class/component");
|
|
10
|
-
* const mockMyClassComponent = new MockClassComponentWrapper(MyClassComponent);
|
|
11
|
-
*/
|
|
12
|
-
declare class MockClassComponentWrapper<T> extends AbstractMockComponentWrapper<T> {
|
|
13
|
-
protected _mock: jest.MockedClass<ReactClassComponentWithProps<T>>;
|
|
14
|
-
constructor(actual: ReactClassComponentWithProps<T>);
|
|
15
|
-
protected _configureMockImplementation: (valueGenerator?: (props: T) => JSX.Element | null) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Not recommended, retrieves the actual mocked component instance
|
|
18
|
-
*
|
|
19
|
-
* Only should be used when truly necessary
|
|
20
|
-
*/
|
|
21
|
-
get __OVERRIDE__mock(): jest.MockedClass<ReactClassComponentWithProps<T>>;
|
|
22
|
-
/**
|
|
23
|
-
* Mocks the return value of the render method
|
|
24
|
-
* @param value The value render should return
|
|
25
|
-
*/
|
|
26
|
-
mockRenderReturnValue: (value: JSX.Element | null) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Mocks the implementation of the render method
|
|
29
|
-
* @param implementation The implementation to apply to render
|
|
30
|
-
*/
|
|
31
|
-
mockRenderImplementation: (implementation: (props: T) => JSX.Element | null) => void;
|
|
32
|
-
}
|
|
33
|
-
export default MockClassComponentWrapper;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import "@testing-library/jest-dom";
|
|
3
|
-
import AbstractMockComponentWrapper from "./AbstractMockComponentWrapper";
|
|
4
|
-
declare type ReactFunctionComponentWithProps<T> = React.FunctionComponent<T>;
|
|
5
|
-
/**
|
|
6
|
-
* A standard mock function component wrapper
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* jest.mock("path/to/my/function/component");
|
|
10
|
-
* const mockMyFunctionComponent = new MockFunctionComponentWrapper(MyFunctionComponent);
|
|
11
|
-
*/
|
|
12
|
-
declare class MockFunctionComponentWrapper<T> extends AbstractMockComponentWrapper<T> {
|
|
13
|
-
protected _mock: jest.MockedFunction<ReactFunctionComponentWithProps<T>>;
|
|
14
|
-
constructor(actual: ReactFunctionComponentWithProps<T>);
|
|
15
|
-
protected _configureMockImplementation: (valueGenerator?: (props: T) => JSX.Element | null) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Not recommended, retrieves the actual mocked component instance
|
|
18
|
-
*
|
|
19
|
-
* Only should be used when truly necessary
|
|
20
|
-
*/
|
|
21
|
-
get __OVERRIDE__mock(): jest.MockedFunction<ReactFunctionComponentWithProps<T>>;
|
|
22
|
-
/**
|
|
23
|
-
* Mocks the return value of the function component
|
|
24
|
-
* @param value The value the mocked function component should return
|
|
25
|
-
*/
|
|
26
|
-
mockReturnValue: (value: JSX.Element | null) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Mocks the implementation of the function component
|
|
29
|
-
* @param implementation The implementation to apply to the mock function component
|
|
30
|
-
*/
|
|
31
|
-
mockImplementation: (implementation: (props: T) => JSX.Element | null) => void;
|
|
32
|
-
}
|
|
33
|
-
export default MockFunctionComponentWrapper;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
declare type AnyFunction = (...args: any[]) => any;
|
|
3
|
-
declare class JestUtilities {
|
|
4
|
-
static assertAsMockFunction: <T extends AnyFunction>(actual: T) => jest.MockedFunction<T>;
|
|
5
|
-
static assertAsMockClass: <T extends jest.Constructable>(actual: T) => jest.MockedClass<T>;
|
|
6
|
-
}
|
|
7
|
-
export default JestUtilities;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import "@testing-library/jest-dom";
|
|
3
|
-
/**
|
|
4
|
-
* Abstract base mock component wrapper class
|
|
5
|
-
*/
|
|
6
|
-
declare abstract class AbstractMockComponentWrapper<T> {
|
|
7
|
-
protected _mock: jest.Mocked<unknown>;
|
|
8
|
-
receivedProps: T;
|
|
9
|
-
/**
|
|
10
|
-
* The data-testid applied to the component mocks
|
|
11
|
-
*/
|
|
12
|
-
DATA_TEST_ID: string;
|
|
13
|
-
constructor();
|
|
14
|
-
private _buildPropsExpectation;
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves the root element of the mocked component, which will
|
|
17
|
-
* always be a div with the component data-testid applied
|
|
18
|
-
*
|
|
19
|
-
* Should only be used when one instance of the mock component is on the screen
|
|
20
|
-
*/
|
|
21
|
-
get mockRoot(): HTMLElement;
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves the root elements of all of the mocked component instances, which will
|
|
24
|
-
* always be a div with the component data-testid applied
|
|
25
|
-
*
|
|
26
|
-
* Can be used when multiple instances of the mock component are on the screen
|
|
27
|
-
*/
|
|
28
|
-
get mockRoots(): HTMLElement[];
|
|
29
|
-
/**
|
|
30
|
-
* Asserts that the mock component was called with the provided subset of props
|
|
31
|
-
* @param props The subset of props to match against
|
|
32
|
-
*/
|
|
33
|
-
assertCalledWith: (props: Partial<T>) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Asserts that the mock component was last called with the provided subset of props
|
|
36
|
-
* @param props The subset of props to match against
|
|
37
|
-
*/
|
|
38
|
-
assertLastCalledWith: (props: Partial<T>) => void;
|
|
39
|
-
/**
|
|
40
|
-
* Asserts that the mock component was nth called with the provided subset of props
|
|
41
|
-
* @param props The subset of props to match against
|
|
42
|
-
* @param n The render number to check against
|
|
43
|
-
*/
|
|
44
|
-
assertNthCalledWith: (props: Partial<T>, n: number) => void;
|
|
45
|
-
/**
|
|
46
|
-
* Asserts that an instance of the component exists within the document
|
|
47
|
-
* @param allowMultiple Optional boolean to allow for multiple instances
|
|
48
|
-
* of the component to exist. When set false, if more than 1 instance
|
|
49
|
-
* of the component is on the screen this assertion will fail.
|
|
50
|
-
* @default true
|
|
51
|
-
*/
|
|
52
|
-
assertOnScreen: (allowMultiple?: boolean) => void;
|
|
53
|
-
/**
|
|
54
|
-
* Asserts that the component is not currently rendered within the document
|
|
55
|
-
*/
|
|
56
|
-
assertNotOnScreen: () => void;
|
|
57
|
-
}
|
|
58
|
-
export default AbstractMockComponentWrapper;
|