@thisisagile/easy-test-react 8.3.6 → 8.4.2
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 +2 -0
- package/dist/Tester.js +2 -0
- package/dist/Tester.js.map +1 -1
- package/package.json +3 -3
- package/src/Tester.ts +3 -1
package/dist/Tester.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare class Tester {
|
|
|
12
12
|
atId: (id: Id) => ElementTester;
|
|
13
13
|
byRole: (role: string) => HTMLElement;
|
|
14
14
|
atRole: (role: string) => ElementTester;
|
|
15
|
+
byTitle: (title: string) => HTMLElement;
|
|
16
|
+
atTitle: (title: string) => ElementTester;
|
|
15
17
|
byPlaceholder: (placeholder: string) => HTMLElement;
|
|
16
18
|
atPlaceholder: (placeholder: string) => ElementTester;
|
|
17
19
|
submit: (id?: Id) => ElementTester;
|
package/dist/Tester.js
CHANGED
|
@@ -13,6 +13,8 @@ class Tester {
|
|
|
13
13
|
this.atId = (id) => new ElementTester_1.ElementTester(() => this.byId(id));
|
|
14
14
|
this.byRole = (role) => (0, react_1.getByRole)(this.container, role);
|
|
15
15
|
this.atRole = (role) => new ElementTester_1.ElementTester(() => this.byRole(role));
|
|
16
|
+
this.byTitle = (title) => (0, react_1.getByTitle)(this.container, title);
|
|
17
|
+
this.atTitle = (title) => new ElementTester_1.ElementTester(() => this.byTitle(title));
|
|
16
18
|
this.byPlaceholder = (placeholder) => (0, react_1.getByPlaceholderText)(this.container, placeholder);
|
|
17
19
|
this.atPlaceholder = (placeholder) => new ElementTester_1.ElementTester(() => this.byPlaceholder(placeholder));
|
|
18
20
|
this.submit = (id = 'btn-submit') => this.atId(id);
|
package/dist/Tester.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tester.js","sourceRoot":"","sources":["../src/Tester.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Tester.js","sourceRoot":"","s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AAS,EAAE,WAAW,CAAC,CAAC;QACxG,kBAAa,GAAG,CAAC,WAAmB,EAAiB,EAAE,CAAC,IAAI,6BAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;QACjH,WAAM,GAAG,CAAC,KAAS,YAAY,EAAiB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAfZ,CAAC;;AADxD,wBAiBC;AAdQ,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,CAAC;AACnH,iBAAU,GAAG,CAAC,SAAuB,EAAU,EAAE,CAAC,IAAI,MAAM,CAAC,IAAA,cAAM,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;AAe5F,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy-test-react",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.2",
|
|
4
4
|
"description": "Straightforward wrapper library for testing-library/react",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@thisisagile/easy-test": "8.
|
|
36
|
+
"@thisisagile/easy-test": "8.4.2",
|
|
37
37
|
"weak-napi": "^2.0.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@testing-library/dom": "8.11.1",
|
|
41
41
|
"@testing-library/jest-dom": "5.14.1",
|
|
42
42
|
"@testing-library/react": "12.1.2",
|
|
43
|
-
"@thisisagile/easy": "8.
|
|
43
|
+
"@thisisagile/easy": "8.4.2",
|
|
44
44
|
"@types/react": "17.0.37",
|
|
45
45
|
"react": "^17.0.2",
|
|
46
46
|
"react-dom": "^17.0.2"
|
package/src/Tester.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getByPlaceholderText, getByRole, getByTestId, getByText, render } from '@testing-library/react';
|
|
1
|
+
import { getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, render } from '@testing-library/react';
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
import { Id } from '@thisisagile/easy';
|
|
4
4
|
import { waitForRender } from './waitForRender';
|
|
@@ -16,6 +16,8 @@ export class Tester {
|
|
|
16
16
|
atId = (id: Id): ElementTester => new ElementTester(() => this.byId(id));
|
|
17
17
|
byRole = (role: string): HTMLElement => getByRole(this.container, role);
|
|
18
18
|
atRole = (role: string): ElementTester => new ElementTester(() => this.byRole(role));
|
|
19
|
+
byTitle = (title: string): HTMLElement => getByTitle(this.container, title);
|
|
20
|
+
atTitle = (title: string): ElementTester => new ElementTester(() => this.byTitle(title));
|
|
19
21
|
byPlaceholder = (placeholder: string): HTMLElement => getByPlaceholderText(this.container, placeholder);
|
|
20
22
|
atPlaceholder = (placeholder: string): ElementTester => new ElementTester(() => this.byPlaceholder(placeholder));
|
|
21
23
|
submit = (id: Id = 'btn-submit'): ElementTester => this.atId(id);
|