@thisisagile/easy-test-react 15.8.3 → 15.8.5
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/dist/{Tester.d.ts → index.d.mts} +23 -4
- package/dist/index.d.ts +43 -3
- package/dist/index.js +1 -20
- package/dist/index.mjs +1 -0
- package/package.json +5 -3
- package/dist/ElementTester.d.ts +0 -14
- package/dist/ElementTester.js +0 -31
- package/dist/ElementTester.js.map +0 -1
- package/dist/Tester.js +0 -32
- package/dist/Tester.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/waitForRender.d.ts +0 -3
- package/dist/waitForRender.js +0 -14
- package/dist/waitForRender.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { Id } from '@thisisagile/easy';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
4
|
+
|
|
5
|
+
declare class Tester {
|
|
5
6
|
readonly container: HTMLElement;
|
|
6
7
|
constructor(container: HTMLElement);
|
|
7
8
|
static render: (component: ReactElement) => Promise<Tester>;
|
|
@@ -20,5 +21,23 @@ export declare class Tester {
|
|
|
20
21
|
atPlaceholder: (placeholder: string, index?: number) => ElementTester;
|
|
21
22
|
submit: (id?: Id) => ElementTester;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
declare const rendersWait: (component: ReactElement) => Promise<Tester>;
|
|
25
|
+
declare const renders: (component: ReactElement) => Tester;
|
|
26
|
+
|
|
27
|
+
declare class ElementTester {
|
|
28
|
+
readonly element: () => Element;
|
|
29
|
+
constructor(element: () => Element);
|
|
30
|
+
get value(): string;
|
|
31
|
+
get isValid(): boolean;
|
|
32
|
+
get then(): Tester;
|
|
33
|
+
click: () => this | undefined;
|
|
34
|
+
awaitClick: () => Promise<boolean>;
|
|
35
|
+
mouseDown: (index?: number) => this | undefined;
|
|
36
|
+
type: (value: string) => boolean;
|
|
37
|
+
wait: () => Promise<Element>;
|
|
38
|
+
waitForRemove: () => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function waitForRender(ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): Promise<RenderResult>;
|
|
42
|
+
|
|
43
|
+
export { ElementTester, Tester, renders, rendersWait, waitForRender };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Id } from '@thisisagile/easy';
|
|
3
|
+
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
4
|
+
|
|
5
|
+
declare class Tester {
|
|
6
|
+
readonly container: HTMLElement;
|
|
7
|
+
constructor(container: HTMLElement);
|
|
8
|
+
static render: (component: ReactElement) => Promise<Tester>;
|
|
9
|
+
static renderSync: (component: ReactElement) => Tester;
|
|
10
|
+
byText: (text: string, index?: number) => HTMLElement;
|
|
11
|
+
atText: (text: string, index?: number) => ElementTester;
|
|
12
|
+
byId: (id: Id, index?: number) => HTMLElement;
|
|
13
|
+
atId: (id: Id, index?: number) => ElementTester;
|
|
14
|
+
byRole: (role: string, index?: number) => HTMLElement;
|
|
15
|
+
atRole: (role: string, index?: number) => ElementTester;
|
|
16
|
+
byRow: (index?: number) => HTMLElement;
|
|
17
|
+
atRow: (index?: number) => ElementTester;
|
|
18
|
+
byTitle: (title: string, index?: number) => HTMLElement;
|
|
19
|
+
atTitle: (title: string, index?: number) => ElementTester;
|
|
20
|
+
byPlaceholder: (placeholder: string, index?: number) => HTMLElement;
|
|
21
|
+
atPlaceholder: (placeholder: string, index?: number) => ElementTester;
|
|
22
|
+
submit: (id?: Id) => ElementTester;
|
|
23
|
+
}
|
|
24
|
+
declare const rendersWait: (component: ReactElement) => Promise<Tester>;
|
|
25
|
+
declare const renders: (component: ReactElement) => Tester;
|
|
26
|
+
|
|
27
|
+
declare class ElementTester {
|
|
28
|
+
readonly element: () => Element;
|
|
29
|
+
constructor(element: () => Element);
|
|
30
|
+
get value(): string;
|
|
31
|
+
get isValid(): boolean;
|
|
32
|
+
get then(): Tester;
|
|
33
|
+
click: () => this | undefined;
|
|
34
|
+
awaitClick: () => Promise<boolean>;
|
|
35
|
+
mouseDown: (index?: number) => this | undefined;
|
|
36
|
+
type: (value: string) => boolean;
|
|
37
|
+
wait: () => Promise<Element>;
|
|
38
|
+
waitForRemove: () => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function waitForRender(ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): Promise<RenderResult>;
|
|
42
|
+
|
|
43
|
+
export { ElementTester, Tester, renders, rendersWait, waitForRender };
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ElementTester"), exports);
|
|
18
|
-
__exportStar(require("./Tester"), exports);
|
|
19
|
-
__exportStar(require("./waitForRender"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var c=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var t in e)c(r,t,{get:e[t],enumerable:!0})},g=(r,e,t,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of y(e))!b.call(r,s)&&s!==t&&c(r,s,{get:()=>e[s],enumerable:!(u=T(e,s))||u.enumerable});return r};var R=r=>g(c({},"__esModule",{value:!0}),r);var f={};h(f,{ElementTester:()=>i,Tester:()=>l,renders:()=>E,rendersWait:()=>w,waitForRender:()=>d});module.exports=R(f);var o=require("@testing-library/react"),a=require("@thisisagile/easy");var n=require("@testing-library/react");var m=require("@testing-library/react");async function d(r,e){let t={};return await(0,m.act)(async()=>{t=(0,m.render)(r,e),await(0,m.waitFor)(()=>t.container,{container:t.container})}),t}var l=class r{constructor(e){this.container=e}static render=e=>d(e).then(t=>new r(t.container));static renderSync=e=>new r((0,n.render)(e).container);byText=(e,t)=>t?n.screen.getAllByText(e)[t]:n.screen.getByText(e);atText=(e,t)=>new i(()=>this.byText(e,t));byId=(e,t)=>t?n.screen.getAllByTestId(e.toString())[t]:n.screen.getByTestId(e.toString());atId=(e,t)=>new i(()=>this.byId(e,t));byRole=(e,t)=>t?n.screen.getAllByRole(e)[t]:n.screen.getByRole(e);atRole=(e,t)=>new i(()=>this.byRole(e,t));byRow=e=>e?n.screen.getAllByRole("row")[e]:n.screen.getByRole("row");atRow=e=>new i(()=>this.byRow(e));byTitle=(e,t)=>t?n.screen.getAllByTitle(e)[t]:n.screen.getByTitle(e);atTitle=(e,t)=>new i(()=>this.byTitle(e,t));byPlaceholder=(e,t)=>t?n.screen.getAllByPlaceholderText(e)[t]:n.screen.getByPlaceholderText(e);atPlaceholder=(e,t)=>new i(()=>this.byPlaceholder(e,t));submit=(e="btn-submit")=>this.atId(e)},w=async r=>await l.render(r),E=r=>l.renderSync(r);var i=class{constructor(e){this.element=e}get value(){return this.element()?.value}get isValid(){return(0,a.tryTo)(()=>this.element()).is.defined().map(()=>!0).or(!1)}get then(){return new l(this.element())}click=()=>this.element()&&o.fireEvent.click(this.element())?this:void 0;awaitClick=()=>(0,o.waitFor)(()=>o.fireEvent.click(this.element()));mouseDown=e=>this.element()&&o.fireEvent.mouseDown((0,a.isDefined)(e)?this.element().children[e]:this.element())?this:void 0;type=e=>o.fireEvent.change(this.element(),{target:{value:e}});wait=()=>(0,o.waitFor)(this.element);waitForRemove=()=>(0,o.waitForElementToBeRemoved)(this.element)};0&&(module.exports={ElementTester,Tester,renders,rendersWait,waitForRender});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fireEvent as l,waitFor as s,waitForElementToBeRemoved as T}from"@testing-library/react";import{isDefined as y,tryTo as b}from"@thisisagile/easy";import{render as u,screen as r}from"@testing-library/react";import{act as a,render as c,waitFor as d}from"@testing-library/react";async function m(n,e){let t={};return await a(async()=>{t=c(n,e),await d(()=>t.container,{container:t.container})}),t}var o=class n{constructor(e){this.container=e}static render=e=>m(e).then(t=>new n(t.container));static renderSync=e=>new n(u(e).container);byText=(e,t)=>t?r.getAllByText(e)[t]:r.getByText(e);atText=(e,t)=>new i(()=>this.byText(e,t));byId=(e,t)=>t?r.getAllByTestId(e.toString())[t]:r.getByTestId(e.toString());atId=(e,t)=>new i(()=>this.byId(e,t));byRole=(e,t)=>t?r.getAllByRole(e)[t]:r.getByRole(e);atRole=(e,t)=>new i(()=>this.byRole(e,t));byRow=e=>e?r.getAllByRole("row")[e]:r.getByRole("row");atRow=e=>new i(()=>this.byRow(e));byTitle=(e,t)=>t?r.getAllByTitle(e)[t]:r.getByTitle(e);atTitle=(e,t)=>new i(()=>this.byTitle(e,t));byPlaceholder=(e,t)=>t?r.getAllByPlaceholderText(e)[t]:r.getByPlaceholderText(e);atPlaceholder=(e,t)=>new i(()=>this.byPlaceholder(e,t));submit=(e="btn-submit")=>this.atId(e)},B=async n=>await o.render(n),P=n=>o.renderSync(n);var i=class{constructor(e){this.element=e}get value(){return this.element()?.value}get isValid(){return b(()=>this.element()).is.defined().map(()=>!0).or(!1)}get then(){return new o(this.element())}click=()=>this.element()&&l.click(this.element())?this:void 0;awaitClick=()=>s(()=>l.click(this.element()));mouseDown=e=>this.element()&&l.mouseDown(y(e)?this.element().children[e]:this.element())?this:void 0;type=e=>l.change(this.element(),{target:{value:e}});wait=()=>s(this.element);waitForRemove=()=>T(this.element)};export{i as ElementTester,o as Tester,P as renders,B as rendersWait,m as waitForRender};
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy-test-react",
|
|
3
|
-
"version": "15.8.
|
|
3
|
+
"version": "15.8.5",
|
|
4
4
|
"description": "Straightforward wrapper library for testing-library/react",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
8
9
|
"types": "dist/index",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
"lint": "yarn g:eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
23
24
|
"format": "yarn g:prettier --check --write src test *.json",
|
|
24
25
|
"build": "yarn g:tsc",
|
|
26
|
+
"build:tsup": "yarn g:tsup",
|
|
25
27
|
"test": "yarn g:jest --coverage",
|
|
26
28
|
"prepack": "yarn g:copy-readme"
|
|
27
29
|
},
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
"access": "public"
|
|
34
36
|
},
|
|
35
37
|
"devDependencies": {
|
|
36
|
-
"@thisisagile/easy-test": "15.8.
|
|
38
|
+
"@thisisagile/easy-test": "15.8.5",
|
|
37
39
|
"jest-environment-jsdom": "^29.5.0",
|
|
38
40
|
"weak-napi": "^2.0.2"
|
|
39
41
|
},
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
"@testing-library/dom": "^9.2.0",
|
|
42
44
|
"@testing-library/jest-dom": "^5.16.5",
|
|
43
45
|
"@testing-library/react": "^14.0.0",
|
|
44
|
-
"@thisisagile/easy": "^15.8.
|
|
46
|
+
"@thisisagile/easy": "^15.8.5",
|
|
45
47
|
"@types/react": "^18.2.12",
|
|
46
48
|
"react": "^18.2.0",
|
|
47
49
|
"react-dom": "^18.2.0"
|
package/dist/ElementTester.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Tester } from './Tester';
|
|
2
|
-
export declare class ElementTester {
|
|
3
|
-
readonly element: () => Element;
|
|
4
|
-
constructor(element: () => Element);
|
|
5
|
-
get value(): string;
|
|
6
|
-
get isValid(): boolean;
|
|
7
|
-
get then(): Tester;
|
|
8
|
-
click: () => this | undefined;
|
|
9
|
-
awaitClick: () => Promise<boolean>;
|
|
10
|
-
mouseDown: (index?: number) => this | undefined;
|
|
11
|
-
type: (value: string) => boolean;
|
|
12
|
-
wait: () => Promise<Element>;
|
|
13
|
-
waitForRemove: () => Promise<void>;
|
|
14
|
-
}
|
package/dist/ElementTester.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ElementTester = void 0;
|
|
4
|
-
const react_1 = require("@testing-library/react");
|
|
5
|
-
const easy_1 = require("@thisisagile/easy");
|
|
6
|
-
const Tester_1 = require("./Tester");
|
|
7
|
-
class ElementTester {
|
|
8
|
-
constructor(element) {
|
|
9
|
-
this.element = element;
|
|
10
|
-
this.click = () => (this.element() && react_1.fireEvent.click(this.element()) ? this : undefined);
|
|
11
|
-
this.awaitClick = () => (0, react_1.waitFor)(() => react_1.fireEvent.click(this.element()));
|
|
12
|
-
this.mouseDown = (index) => this.element() && react_1.fireEvent.mouseDown((0, easy_1.isDefined)(index) ? this.element().children[index] : this.element()) ? this : undefined;
|
|
13
|
-
this.type = (value) => react_1.fireEvent.change(this.element(), { target: { value } });
|
|
14
|
-
this.wait = () => (0, react_1.waitFor)(this.element);
|
|
15
|
-
this.waitForRemove = () => (0, react_1.waitForElementToBeRemoved)(this.element);
|
|
16
|
-
}
|
|
17
|
-
get value() {
|
|
18
|
-
return this.element()?.value;
|
|
19
|
-
}
|
|
20
|
-
get isValid() {
|
|
21
|
-
return (0, easy_1.tryTo)(() => this.element())
|
|
22
|
-
.is.defined()
|
|
23
|
-
.map(() => true)
|
|
24
|
-
.or(false);
|
|
25
|
-
}
|
|
26
|
-
get then() {
|
|
27
|
-
return new Tester_1.Tester(this.element());
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.ElementTester = ElementTester;
|
|
31
|
-
//# sourceMappingURL=ElementTester.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElementTester.js","sourceRoot":"","sources":["../src/ElementTester.ts"],"names":[],"mappings":";;;AAAA,kDAAuF;AACvF,4CAAqD;AACrD,qCAAkC;AAElC,MAAa,aAAa;IACxB,YAAqB,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QAiB3C,UAAK,GAAG,GAAqB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,iBAAS,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACvG,eAAU,GAAG,GAAqB,EAAE,CAAC,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,iBAAS,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACpF,cAAS,GAAG,CAAC,KAAc,EAAoB,EAAE,CAC/C,IAAI,CAAC,OAAO,EAAE,IAAI,iBAAS,CAAC,SAAS,CAAC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/H,SAAI,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,iBAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC3F,SAAI,GAAG,GAAqB,EAAE,CAAC,IAAA,eAAO,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrD,kBAAa,GAAG,GAAkB,EAAE,CAAC,IAAA,iCAAyB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAvB/B,CAAC;IAE/C,IAAI,KAAK;QACP,OAAQ,IAAI,CAAC,OAAO,EAAU,EAAE,KAAe,CAAC;IAClD,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAA,YAAK,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;aAC/B,EAAE,CAAC,OAAO,EAAE;aACZ,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aACf,EAAE,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,eAAM,CAAC,IAAI,CAAC,OAAO,EAAiB,CAAC,CAAC;IACnD,CAAC;CASF;AAzBD,sCAyBC"}
|
package/dist/Tester.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renders = exports.rendersWait = exports.Tester = void 0;
|
|
4
|
-
const react_1 = require("@testing-library/react");
|
|
5
|
-
const waitForRender_1 = require("./waitForRender");
|
|
6
|
-
const ElementTester_1 = require("./ElementTester");
|
|
7
|
-
class Tester {
|
|
8
|
-
constructor(container) {
|
|
9
|
-
this.container = container;
|
|
10
|
-
this.byText = (text, index) => (index ? react_1.screen.getAllByText(text)[index] : react_1.screen.getByText(text));
|
|
11
|
-
this.atText = (text, index) => new ElementTester_1.ElementTester(() => this.byText(text, index));
|
|
12
|
-
this.byId = (id, index) => (index ? react_1.screen.getAllByTestId(id.toString())[index] : react_1.screen.getByTestId(id.toString()));
|
|
13
|
-
this.atId = (id, index) => new ElementTester_1.ElementTester(() => this.byId(id, index));
|
|
14
|
-
this.byRole = (role, index) => (index ? react_1.screen.getAllByRole(role)[index] : react_1.screen.getByRole(role));
|
|
15
|
-
this.atRole = (role, index) => new ElementTester_1.ElementTester(() => this.byRole(role, index));
|
|
16
|
-
this.byRow = (index) => (index ? react_1.screen.getAllByRole('row')[index] : react_1.screen.getByRole('row'));
|
|
17
|
-
this.atRow = (index) => new ElementTester_1.ElementTester(() => this.byRow(index));
|
|
18
|
-
this.byTitle = (title, index) => (index ? react_1.screen.getAllByTitle(title)[index] : react_1.screen.getByTitle(title));
|
|
19
|
-
this.atTitle = (title, index) => new ElementTester_1.ElementTester(() => this.byTitle(title, index));
|
|
20
|
-
this.byPlaceholder = (placeholder, index) => index ? react_1.screen.getAllByPlaceholderText(placeholder)[index] : react_1.screen.getByPlaceholderText(placeholder);
|
|
21
|
-
this.atPlaceholder = (placeholder, index) => new ElementTester_1.ElementTester(() => this.byPlaceholder(placeholder, index));
|
|
22
|
-
this.submit = (id = 'btn-submit') => this.atId(id);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.Tester = Tester;
|
|
26
|
-
Tester.render = (component) => (0, waitForRender_1.waitForRender)(component).then(c => new Tester(c.container));
|
|
27
|
-
Tester.renderSync = (component) => new Tester((0, react_1.render)(component).container);
|
|
28
|
-
const rendersWait = async (component) => await Tester.render(component);
|
|
29
|
-
exports.rendersWait = rendersWait;
|
|
30
|
-
const renders = (component) => Tester.renderSync(component);
|
|
31
|
-
exports.renders = renders;
|
|
32
|
-
//# sourceMappingURL=Tester.js.map
|
package/dist/Tester.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|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AAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAlBZ,CAAC;;AADxD,wBAoBC;AAjBQ,aAAM,GAAG,CAAC,SAAuB,EAAmB,EAAE,CAAC,IAAA,6BAAa,EAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,AAA5G,CAA6G;AACnH,iBAAU,GAAG,CAAC,SAAuB,EAAU,EAAE,CAAC,IAAI,MAAM,CAAC,IAAA,cAAM,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC,AAA/E,CAAgF;AAkB5F,MAAM,WAAW,GAAG,KAAK,EAAE,SAAuB,EAAmB,EAAE,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAAjG,QAAA,WAAW,eAAsF;AACvG,MAAM,OAAO,GAAG,CAAC,SAAuB,EAAU,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAA5E,QAAA,OAAO,WAAqE"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,2CAAyB;AACzB,kDAAgC"}
|
package/dist/waitForRender.d.ts
DELETED
package/dist/waitForRender.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitForRender = void 0;
|
|
4
|
-
const react_1 = require("@testing-library/react");
|
|
5
|
-
async function waitForRender(ui, options) {
|
|
6
|
-
let r = {};
|
|
7
|
-
await (0, react_1.act)(async () => {
|
|
8
|
-
r = (0, react_1.render)(ui, options);
|
|
9
|
-
await (0, react_1.waitFor)(() => r.container, { container: r.container });
|
|
10
|
-
});
|
|
11
|
-
return r;
|
|
12
|
-
}
|
|
13
|
-
exports.waitForRender = waitForRender;
|
|
14
|
-
//# sourceMappingURL=waitForRender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"waitForRender.js","sourceRoot":"","sources":["../src/waitForRender.ts"],"names":[],"mappings":";;;AAAA,kDAA2F;AAIpF,KAAK,UAAU,aAAa,CAAC,EAAgB,EAAE,OAAwC;IAC5F,IAAI,CAAC,GAAG,EAAkB,CAAC;IAE3B,MAAM,IAAA,WAAG,EAAC,KAAK,IAAI,EAAE;QACnB,CAAC,GAAG,IAAA,cAAM,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACxB,MAAM,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,CAAC;AACX,CAAC;AARD,sCAQC"}
|