@jobber/hooks 1.13.1 → 1.13.2-pre0.7
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/CHANGELOG.md +8 -0
- package/README.mdx +9 -1
- package/dist/useCollectionQuery/useCollectionQuery.test.js +21 -12
- package/dist/useFocusTrap/useFocusTrap.d.ts +0 -1
- package/dist/useFormState/useFormState.d.ts +0 -1
- package/dist/useResizeObserver/useResizeObserver.d.ts +0 -1
- package/package.json +5 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.13.2](https://github.com/GetJobber/atlantis/compare/@jobber/hooks@1.13.1...@jobber/hooks@1.13.2) (2023-03-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @jobber/hooks
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.13.1](https://github.com/GetJobber/atlantis/compare/@jobber/hooks@1.13.0...@jobber/hooks@1.13.1) (2023-03-07)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @jobber/hooks
|
package/README.mdx
CHANGED
|
@@ -4,7 +4,15 @@ Shared hooks for components in Atlantis.
|
|
|
4
4
|
|
|
5
5
|
## Hooks
|
|
6
6
|
|
|
7
|
-
- [
|
|
7
|
+
- [useAssert](../?path=/docs/hooks-useassert--page)
|
|
8
|
+
- [useCollectionQuery](../?path=/docs/hooks-usecollectionquery--use-collection-query)
|
|
9
|
+
- [useFormState](../?path=/docs/hooks-useformstate--use-form-state)
|
|
10
|
+
- [useIsMounted](../?path=/docs/hooks-useismounted--use-is-mounted)
|
|
11
|
+
- [useLiveAnnounce](../?path=/docs/hooks-useliveannounce--use-live-announce)
|
|
12
|
+
- [useOnKeyDown](../?path=/docs/hooks-useonkeydown--use-on-key-down)
|
|
13
|
+
- [usePasswordStrength](../?path=/docs/hooks-usepasswordstrength--use-password-strength)
|
|
14
|
+
- [useRefocusOnActivator](../?path=/docs/hooks-userefocusonactivator--use-refocus-on-activator)
|
|
15
|
+
- [useResizeObserver](../?path=/docs/packages-hooks--page)
|
|
8
16
|
|
|
9
17
|
## Installing
|
|
10
18
|
|
|
@@ -41,6 +41,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
43
|
var react_hooks_1 = require("@testing-library/react-hooks");
|
|
44
|
+
var react_1 = require("@testing-library/react");
|
|
44
45
|
var useCollectionQuery_1 = require("./useCollectionQuery");
|
|
45
46
|
var test_utilities_1 = require("./test-utilities");
|
|
46
47
|
beforeEach(function () {
|
|
@@ -186,9 +187,8 @@ describe("useCollectionQuery", function () {
|
|
|
186
187
|
describe("when nextPage is called while it's still loadingNextPage", function () {
|
|
187
188
|
it("should not trigger a nextPage", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
189
|
var result;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
switch (_e.label) {
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
192
|
case 0:
|
|
193
193
|
result = react_hooks_1.renderHook(function () { return useCollectionQueryHook(query); }, {
|
|
194
194
|
wrapper: test_utilities_1.wrapper([
|
|
@@ -199,7 +199,7 @@ describe("useCollectionQuery", function () {
|
|
|
199
199
|
}).result;
|
|
200
200
|
return [4 /*yield*/, react_hooks_1.act(test_utilities_1.wait)];
|
|
201
201
|
case 1:
|
|
202
|
-
|
|
202
|
+
_a.sent();
|
|
203
203
|
react_hooks_1.act(function () {
|
|
204
204
|
result.current.nextPage();
|
|
205
205
|
});
|
|
@@ -208,8 +208,13 @@ describe("useCollectionQuery", function () {
|
|
|
208
208
|
});
|
|
209
209
|
return [4 /*yield*/, react_hooks_1.act(test_utilities_1.wait)];
|
|
210
210
|
case 2:
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
_a.sent();
|
|
212
|
+
return [4 /*yield*/, react_1.waitFor(function () {
|
|
213
|
+
var _a, _b, _c;
|
|
214
|
+
expect((_c = (_b = (_a = result.current.data) === null || _a === void 0 ? void 0 : _a.conversation) === null || _b === void 0 ? void 0 : _b.smsMessages) === null || _c === void 0 ? void 0 : _c.edges).toHaveLength(2);
|
|
215
|
+
})];
|
|
216
|
+
case 3:
|
|
217
|
+
_a.sent();
|
|
213
218
|
return [2 /*return*/];
|
|
214
219
|
}
|
|
215
220
|
});
|
|
@@ -277,9 +282,8 @@ describe("useCollectionQuery", function () {
|
|
|
277
282
|
describe("when there is no error", function () {
|
|
278
283
|
it("should update data", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
279
284
|
var result;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
switch (_e.label) {
|
|
285
|
+
return __generator(this, function (_a) {
|
|
286
|
+
switch (_a.label) {
|
|
283
287
|
case 0:
|
|
284
288
|
result = react_hooks_1.renderHook(function () { return useCollectionQueryHook(query); }, {
|
|
285
289
|
wrapper: test_utilities_1.wrapper([
|
|
@@ -289,14 +293,19 @@ describe("useCollectionQuery", function () {
|
|
|
289
293
|
}).result;
|
|
290
294
|
return [4 /*yield*/, react_hooks_1.act(test_utilities_1.wait)];
|
|
291
295
|
case 1:
|
|
292
|
-
|
|
296
|
+
_a.sent();
|
|
293
297
|
react_hooks_1.act(function () {
|
|
294
298
|
result.current.nextPage();
|
|
295
299
|
});
|
|
296
300
|
return [4 /*yield*/, react_hooks_1.act(test_utilities_1.wait)];
|
|
297
301
|
case 2:
|
|
298
|
-
|
|
299
|
-
|
|
302
|
+
_a.sent();
|
|
303
|
+
return [4 /*yield*/, react_1.waitFor(function () {
|
|
304
|
+
var _a, _b, _c;
|
|
305
|
+
expect((_c = (_b = (_a = result.current.data) === null || _a === void 0 ? void 0 : _a.conversation) === null || _b === void 0 ? void 0 : _b.smsMessages) === null || _c === void 0 ? void 0 : _c.edges).toHaveLength(2);
|
|
306
|
+
})];
|
|
307
|
+
case 3:
|
|
308
|
+
_a.sent();
|
|
300
309
|
return [2 /*return*/];
|
|
301
310
|
}
|
|
302
311
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/hooks",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2-pre0.7+6695bed1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.js",
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
"dist/*"
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@apollo/client": "^3.3.16",
|
|
18
17
|
"@apollo/react-testing": "^4.0.0",
|
|
19
|
-
"@jobber/formatters": "^0.2.
|
|
18
|
+
"@jobber/formatters": "^0.2.2-pre0.40+6695bed1",
|
|
20
19
|
"@testing-library/react": "^14.0.0",
|
|
21
20
|
"@testing-library/react-hooks": "^7.0.0",
|
|
22
21
|
"@testing-library/user-event": "^12.0.2",
|
|
@@ -25,7 +24,6 @@
|
|
|
25
24
|
"@types/react-dom": "^18.0.11",
|
|
26
25
|
"@types/uuid": "^8.3.3",
|
|
27
26
|
"@types/zxcvbn": "^4.4.1",
|
|
28
|
-
"graphql": "^14.6.0",
|
|
29
27
|
"typescript": "^3.8.3",
|
|
30
28
|
"uuid": "^8.3.2"
|
|
31
29
|
},
|
|
@@ -38,8 +36,8 @@
|
|
|
38
36
|
"zxcvbn": "^4.4.2"
|
|
39
37
|
},
|
|
40
38
|
"peerDependencies": {
|
|
41
|
-
"@apollo/client": "^3.
|
|
42
|
-
"react": "
|
|
39
|
+
"@apollo/client": "^3.7.10",
|
|
40
|
+
"react": "^18"
|
|
43
41
|
},
|
|
44
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "6695bed1d371d60cf3f6fa6a02c2819d576bf410"
|
|
45
43
|
}
|