@thisisagile/easy-test-react 17.11.16 → 17.11.17
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/ElementTester.mjs +2 -2
- package/dist/Tester.mjs +2 -2
- package/dist/{chunk-PVNTZBJD.mjs → chunk-G3PT2FWF.mjs} +2 -2
- package/dist/{chunk-ZGG2OAIC.mjs → chunk-UIR5DDLV.mjs} +3 -2
- package/dist/{chunk-ZGG2OAIC.mjs.map → chunk-UIR5DDLV.mjs.map} +1 -1
- package/dist/index.js +17 -16
- package/dist/index.js.map +1 -1
- package/dist/waitForRender.mjs +1 -1
- package/package.json +5 -5
- package/src/waitForRender.ts +2 -2
- /package/dist/{chunk-PVNTZBJD.mjs.map → chunk-G3PT2FWF.mjs.map} +0 -0
package/dist/ElementTester.mjs
CHANGED
package/dist/Tester.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
waitForRender
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UIR5DDLV.mjs";
|
|
4
4
|
|
|
5
5
|
// src/Tester.ts
|
|
6
6
|
import { render, screen } from "@testing-library/react";
|
|
@@ -59,4 +59,4 @@ export {
|
|
|
59
59
|
renders,
|
|
60
60
|
ElementTester
|
|
61
61
|
};
|
|
62
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-G3PT2FWF.mjs.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/waitForRender.ts
|
|
2
|
-
import {
|
|
2
|
+
import { render, waitFor } from "@testing-library/react";
|
|
3
|
+
import { act } from "react";
|
|
3
4
|
async function waitForRender(ui, options) {
|
|
4
5
|
let r = {};
|
|
5
6
|
await act(async () => {
|
|
@@ -12,4 +13,4 @@ async function waitForRender(ui, options) {
|
|
|
12
13
|
export {
|
|
13
14
|
waitForRender
|
|
14
15
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-UIR5DDLV.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/waitForRender.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/waitForRender.ts"],"sourcesContent":["import { render, RenderOptions, RenderResult, waitFor } from '@testing-library/react';\nimport { act, ReactElement } from 'react';\n\n/* istanbul ignore next */\nexport async function waitForRender(ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): Promise<RenderResult> {\n let r = {} as RenderResult;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n await act(async () => {\n r = render(ui, options);\n await waitFor(() => r.container, { container: r.container });\n });\n return r;\n}\n"],"mappings":";AAAA,SAAS,QAAqC,eAAe;AAC7D,SAAS,WAAyB;AAGlC,eAAsB,cAAc,IAAkB,SAAiE;AACrH,MAAI,IAAI,CAAC;AAET,QAAM,IAAI,YAAY;AACpB,QAAI,OAAO,IAAI,OAAO;AACtB,UAAM,QAAQ,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC;AAAA,EAC7D,CAAC;AACD,SAAO;AACT;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -30,17 +30,18 @@ __export(src_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(src_exports);
|
|
31
31
|
|
|
32
32
|
// src/ElementTester.ts
|
|
33
|
-
var
|
|
33
|
+
var import_react4 = require("@testing-library/react");
|
|
34
34
|
var import_easy = require("@thisisagile/easy");
|
|
35
35
|
|
|
36
36
|
// src/Tester.ts
|
|
37
|
-
var
|
|
37
|
+
var import_react3 = require("@testing-library/react");
|
|
38
38
|
|
|
39
39
|
// src/waitForRender.ts
|
|
40
40
|
var import_react = require("@testing-library/react");
|
|
41
|
+
var import_react2 = require("react");
|
|
41
42
|
async function waitForRender(ui, options) {
|
|
42
43
|
let r = {};
|
|
43
|
-
await (0,
|
|
44
|
+
await (0, import_react2.act)(async () => {
|
|
44
45
|
r = (0, import_react.render)(ui, options);
|
|
45
46
|
await (0, import_react.waitFor)(() => r.container, { container: r.container });
|
|
46
47
|
});
|
|
@@ -53,18 +54,18 @@ var Tester = class _Tester {
|
|
|
53
54
|
this.container = container;
|
|
54
55
|
}
|
|
55
56
|
static render = (component) => waitForRender(component).then((c) => new _Tester(c.container));
|
|
56
|
-
static renderSync = (component) => new _Tester((0,
|
|
57
|
-
byText = (text, index) => index ?
|
|
57
|
+
static renderSync = (component) => new _Tester((0, import_react3.render)(component).container);
|
|
58
|
+
byText = (text, index) => index ? import_react3.screen.getAllByText(text)[index] : import_react3.screen.getByText(text);
|
|
58
59
|
atText = (text, index) => new ElementTester(() => this.byText(text, index));
|
|
59
|
-
byId = (id, index) => index ?
|
|
60
|
+
byId = (id, index) => index ? import_react3.screen.getAllByTestId(id.toString())[index] : import_react3.screen.getByTestId(id.toString());
|
|
60
61
|
atId = (id, index) => new ElementTester(() => this.byId(id, index));
|
|
61
|
-
byRole = (role, index) => index ?
|
|
62
|
+
byRole = (role, index) => index ? import_react3.screen.getAllByRole(role)[index] : import_react3.screen.getByRole(role);
|
|
62
63
|
atRole = (role, index) => new ElementTester(() => this.byRole(role, index));
|
|
63
|
-
byRow = (index) => index ?
|
|
64
|
+
byRow = (index) => index ? import_react3.screen.getAllByRole("row")[index] : import_react3.screen.getByRole("row");
|
|
64
65
|
atRow = (index) => new ElementTester(() => this.byRow(index));
|
|
65
|
-
byTitle = (title, index) => index ?
|
|
66
|
+
byTitle = (title, index) => index ? import_react3.screen.getAllByTitle(title)[index] : import_react3.screen.getByTitle(title);
|
|
66
67
|
atTitle = (title, index) => new ElementTester(() => this.byTitle(title, index));
|
|
67
|
-
byPlaceholder = (placeholder, index) => index ?
|
|
68
|
+
byPlaceholder = (placeholder, index) => index ? import_react3.screen.getAllByPlaceholderText(placeholder)[index] : import_react3.screen.getByPlaceholderText(placeholder);
|
|
68
69
|
atPlaceholder = (placeholder, index) => new ElementTester(() => this.byPlaceholder(placeholder, index));
|
|
69
70
|
submit = (id = "btn-submit") => this.atId(id);
|
|
70
71
|
};
|
|
@@ -85,12 +86,12 @@ var ElementTester = class {
|
|
|
85
86
|
get then() {
|
|
86
87
|
return new Tester(this.element());
|
|
87
88
|
}
|
|
88
|
-
click = () => this.element() &&
|
|
89
|
-
awaitClick = () => (0,
|
|
90
|
-
mouseDown = (index) => this.element() &&
|
|
91
|
-
type = (value) =>
|
|
92
|
-
wait = () => (0,
|
|
93
|
-
waitForRemove = () => (0,
|
|
89
|
+
click = () => this.element() && import_react4.fireEvent.click(this.element()) ? this : void 0;
|
|
90
|
+
awaitClick = () => (0, import_react4.waitFor)(() => import_react4.fireEvent.click(this.element()));
|
|
91
|
+
mouseDown = (index) => this.element() && import_react4.fireEvent.mouseDown((0, import_easy.isDefined)(index) ? this.element().children[index] : this.element()) ? this : void 0;
|
|
92
|
+
type = (value) => import_react4.fireEvent.change(this.element(), { target: { value } });
|
|
93
|
+
wait = () => (0, import_react4.waitFor)(this.element);
|
|
94
|
+
waitForRemove = () => (0, import_react4.waitForElementToBeRemoved)(this.element);
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
// src/index.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/ElementTester.ts","../src/Tester.ts","../src/waitForRender.ts"],"sourcesContent":["export * from './ElementTester';\nexport * from './Tester';\nexport * from './waitForRender';\n\nexport const mockTimezone = () => {\n jest.spyOn(Intl.DateTimeFormat.prototype, 'resolvedOptions').mockReturnValue(Intl.DateTimeFormat('en-US', { timeZone: 'UTC' }).resolvedOptions());\n};\nmockTimezone();\n","import { fireEvent, waitFor, waitForElementToBeRemoved } from '@testing-library/react';\nimport { isDefined, tryTo } from '@thisisagile/easy';\nimport { Tester } from './Tester';\n\nexport class ElementTester {\n constructor(readonly element: () => Element) {}\n\n get value(): string {\n return (this.element() as any)?.value as string;\n }\n\n get isValid(): boolean {\n return tryTo(() => this.element())\n .is.defined()\n .map(() => true)\n .or(false);\n }\n\n get then(): Tester {\n return new Tester(this.element() as HTMLElement);\n }\n\n click = (): this | undefined => (this.element() && fireEvent.click(this.element()) ? this : undefined);\n awaitClick = (): Promise<boolean> => waitFor(() => fireEvent.click(this.element()));\n mouseDown = (index?: number): this | undefined =>\n this.element() && fireEvent.mouseDown(isDefined(index) ? this.element().children[index] : this.element()) ? this : undefined;\n type = (value: string): boolean => fireEvent.change(this.element(), { target: { value } });\n wait = (): Promise<Element> => waitFor(this.element);\n waitForRemove = (): Promise<void> => waitForElementToBeRemoved(this.element);\n}\n","import { render, screen } from '@testing-library/react';\nimport { ReactElement } from 'react';\nimport { Id } from '@thisisagile/easy';\nimport { waitForRender } from './waitForRender';\nimport { ElementTester } from './ElementTester';\n\nexport class Tester {\n constructor(public readonly container: HTMLElement) {}\n\n static render = (component: ReactElement): Promise<Tester> => waitForRender(component).then(c => new Tester(c.container));\n static renderSync = (component: ReactElement): Tester => new Tester(render(component).container);\n\n byText = (text: string, index?: number): HTMLElement => (index ? screen.getAllByText(text)[index] : screen.getByText(text));\n atText = (text: string, index?: number): ElementTester => new ElementTester(() => this.byText(text, index));\n byId = (id: Id, index?: number): HTMLElement => (index ? screen.getAllByTestId(id.toString())[index] : screen.getByTestId(id.toString()));\n atId = (id: Id, index?: number): ElementTester => new ElementTester(() => this.byId(id, index));\n byRole = (role: string, index?: number): HTMLElement => (index ? screen.getAllByRole(role)[index] : screen.getByRole(role));\n atRole = (role: string, index?: number): ElementTester => new ElementTester(() => this.byRole(role, index));\n byRow = (index?: number): HTMLElement => (index ? screen.getAllByRole('row')[index] : screen.getByRole('row'));\n atRow = (index?: number): ElementTester => new ElementTester(() => this.byRow(index));\n byTitle = (title: string, index?: number): HTMLElement => (index ? screen.getAllByTitle(title)[index] : screen.getByTitle(title));\n atTitle = (title: string, index?: number): ElementTester => new ElementTester(() => this.byTitle(title, index));\n byPlaceholder = (placeholder: string, index?: number): HTMLElement =>\n index ? screen.getAllByPlaceholderText(placeholder)[index] : screen.getByPlaceholderText(placeholder);\n atPlaceholder = (placeholder: string, index?: number): ElementTester => new ElementTester(() => this.byPlaceholder(placeholder, index));\n submit = (id: Id = 'btn-submit'): ElementTester => this.atId(id);\n}\n\nexport const rendersWait = async (component: ReactElement): Promise<Tester> => await Tester.render(component);\nexport const renders = (component: ReactElement): Tester => Tester.renderSync(component);\n","import {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/ElementTester.ts","../src/Tester.ts","../src/waitForRender.ts"],"sourcesContent":["export * from './ElementTester';\nexport * from './Tester';\nexport * from './waitForRender';\n\nexport const mockTimezone = () => {\n jest.spyOn(Intl.DateTimeFormat.prototype, 'resolvedOptions').mockReturnValue(Intl.DateTimeFormat('en-US', { timeZone: 'UTC' }).resolvedOptions());\n};\nmockTimezone();\n","import { fireEvent, waitFor, waitForElementToBeRemoved } from '@testing-library/react';\nimport { isDefined, tryTo } from '@thisisagile/easy';\nimport { Tester } from './Tester';\n\nexport class ElementTester {\n constructor(readonly element: () => Element) {}\n\n get value(): string {\n return (this.element() as any)?.value as string;\n }\n\n get isValid(): boolean {\n return tryTo(() => this.element())\n .is.defined()\n .map(() => true)\n .or(false);\n }\n\n get then(): Tester {\n return new Tester(this.element() as HTMLElement);\n }\n\n click = (): this | undefined => (this.element() && fireEvent.click(this.element()) ? this : undefined);\n awaitClick = (): Promise<boolean> => waitFor(() => fireEvent.click(this.element()));\n mouseDown = (index?: number): this | undefined =>\n this.element() && fireEvent.mouseDown(isDefined(index) ? this.element().children[index] : this.element()) ? this : undefined;\n type = (value: string): boolean => fireEvent.change(this.element(), { target: { value } });\n wait = (): Promise<Element> => waitFor(this.element);\n waitForRemove = (): Promise<void> => waitForElementToBeRemoved(this.element);\n}\n","import { render, screen } from '@testing-library/react';\nimport { ReactElement } from 'react';\nimport { Id } from '@thisisagile/easy';\nimport { waitForRender } from './waitForRender';\nimport { ElementTester } from './ElementTester';\n\nexport class Tester {\n constructor(public readonly container: HTMLElement) {}\n\n static render = (component: ReactElement): Promise<Tester> => waitForRender(component).then(c => new Tester(c.container));\n static renderSync = (component: ReactElement): Tester => new Tester(render(component).container);\n\n byText = (text: string, index?: number): HTMLElement => (index ? screen.getAllByText(text)[index] : screen.getByText(text));\n atText = (text: string, index?: number): ElementTester => new ElementTester(() => this.byText(text, index));\n byId = (id: Id, index?: number): HTMLElement => (index ? screen.getAllByTestId(id.toString())[index] : screen.getByTestId(id.toString()));\n atId = (id: Id, index?: number): ElementTester => new ElementTester(() => this.byId(id, index));\n byRole = (role: string, index?: number): HTMLElement => (index ? screen.getAllByRole(role)[index] : screen.getByRole(role));\n atRole = (role: string, index?: number): ElementTester => new ElementTester(() => this.byRole(role, index));\n byRow = (index?: number): HTMLElement => (index ? screen.getAllByRole('row')[index] : screen.getByRole('row'));\n atRow = (index?: number): ElementTester => new ElementTester(() => this.byRow(index));\n byTitle = (title: string, index?: number): HTMLElement => (index ? screen.getAllByTitle(title)[index] : screen.getByTitle(title));\n atTitle = (title: string, index?: number): ElementTester => new ElementTester(() => this.byTitle(title, index));\n byPlaceholder = (placeholder: string, index?: number): HTMLElement =>\n index ? screen.getAllByPlaceholderText(placeholder)[index] : screen.getByPlaceholderText(placeholder);\n atPlaceholder = (placeholder: string, index?: number): ElementTester => new ElementTester(() => this.byPlaceholder(placeholder, index));\n submit = (id: Id = 'btn-submit'): ElementTester => this.atId(id);\n}\n\nexport const rendersWait = async (component: ReactElement): Promise<Tester> => await Tester.render(component);\nexport const renders = (component: ReactElement): Tester => Tester.renderSync(component);\n","import { render, RenderOptions, RenderResult, waitFor } from '@testing-library/react';\nimport { act, ReactElement } from 'react';\n\n/* istanbul ignore next */\nexport async function waitForRender(ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): Promise<RenderResult> {\n let r = {} as RenderResult;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n await act(async () => {\n r = render(ui, options);\n await waitFor(() => r.container, { container: r.container });\n });\n return r;\n}\n"],"mappings":";;;;;;;;;;;;;;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AAU,MAAM,KAAK,QAAQ,CAAC,CAAC;AAAA,EAClF,YAAY,CAAC,UACX,KAAK,QAAQ,KAAK,wBAAU,cAAU,uBAAU,KAAK,IAAI,KAAK,QAAQ,EAAE,SAAS,KAAK,IAAI,KAAK,QAAQ,CAAC,IAAI,OAAO;AAAA,EACrH,OAAO,CAAC,UAA2B,wBAAU,OAAO,KAAK,QAAQ,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAAA,EACzF,OAAO,UAAwB,uBAAQ,KAAK,OAAO;AAAA,EACnD,gBAAgB,UAAqB,yCAA0B,KAAK,OAAO;AAC7E;;;ADzBO,IAAM,eAAe,MAAM;AAChC,OAAK,MAAM,KAAK,eAAe,WAAW,iBAAiB,EAAE,gBAAgB,KAAK,eAAe,SAAS,EAAE,UAAU,MAAM,CAAC,EAAE,gBAAgB,CAAC;AAClJ;AACA,aAAa;","names":["import_react","import_react","import_react"]}
|
package/dist/waitForRender.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy-test-react",
|
|
3
|
-
"version": "17.11.
|
|
3
|
+
"version": "17.11.17",
|
|
4
4
|
"description": "Straightforward wrapper library for testing-library/react",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"weak-napi": "^2.0.2"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@testing-library/dom": "^
|
|
45
|
-
"@testing-library/jest-dom": "^6.
|
|
46
|
-
"@testing-library/react": "^
|
|
47
|
-
"@thisisagile/easy": "^17.11.
|
|
44
|
+
"@testing-library/dom": "^10.4.0",
|
|
45
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
46
|
+
"@testing-library/react": "^16.1.0",
|
|
47
|
+
"@thisisagile/easy": "^17.11.17",
|
|
48
48
|
"@types/react": "^18.3.11",
|
|
49
49
|
"react": "^18.3.1",
|
|
50
50
|
"react-dom": "^18.3.1"
|
package/src/waitForRender.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { render, RenderOptions, RenderResult, waitFor } from '@testing-library/react';
|
|
2
|
+
import { act, ReactElement } from 'react';
|
|
3
3
|
|
|
4
4
|
/* istanbul ignore next */
|
|
5
5
|
export async function waitForRender(ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): Promise<RenderResult> {
|
|
File without changes
|