@jobber/hooks 2.6.2-dependabot.0 → 2.6.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.
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
@@ -14,27 +23,27 @@ it("should focus on the ref target on mount", () => {
|
|
|
14
23
|
const { getByTestId } = (0, react_2.render)(react_1.default.createElement(TestComponent, null));
|
|
15
24
|
expect(getByTestId(targetId)).toHaveFocus();
|
|
16
25
|
});
|
|
17
|
-
it("should focus on the ref target when tabbing out of the last focusable element and ignore the tabindex'=-1'", () => {
|
|
26
|
+
it("should focus on the ref target when tabbing out of the last focusable element and ignore the tabindex'=-1'", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
27
|
const { getByTestId } = (0, react_2.render)(react_1.default.createElement(TestComponent, null));
|
|
19
28
|
getByTestId(lastFocusableChild).focus();
|
|
20
|
-
user_event_1.default.tab();
|
|
29
|
+
yield user_event_1.default.tab();
|
|
21
30
|
expect(getByTestId(targetId)).toHaveFocus();
|
|
22
|
-
});
|
|
23
|
-
it("should focus on the first focusable element", () => {
|
|
31
|
+
}));
|
|
32
|
+
it("should focus on the first focusable element", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
33
|
const { getByTestId } = (0, react_2.render)(react_1.default.createElement(TestComponent, null));
|
|
25
|
-
user_event_1.default.tab();
|
|
34
|
+
yield user_event_1.default.tab();
|
|
26
35
|
expect(getByTestId(firstFocusableChild)).toHaveFocus();
|
|
27
|
-
});
|
|
28
|
-
it("should focus on the last focusable element", () => {
|
|
36
|
+
}));
|
|
37
|
+
it("should focus on the last focusable element", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
38
|
const { getByTestId } = (0, react_2.render)(react_1.default.createElement(TestComponent, null));
|
|
30
|
-
user_event_1.default.tab({ shift: true });
|
|
39
|
+
yield user_event_1.default.tab({ shift: true });
|
|
31
40
|
expect(getByTestId(lastFocusableChild)).toHaveFocus();
|
|
32
|
-
});
|
|
33
|
-
it("should not trap the tabbing and focus on the first child node", () => {
|
|
41
|
+
}));
|
|
42
|
+
it("should not trap the tabbing and focus on the first child node", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
43
|
const { getByTestId } = (0, react_2.render)(react_1.default.createElement(TestComponent, { trap: false }));
|
|
35
|
-
user_event_1.default.tab();
|
|
44
|
+
yield user_event_1.default.tab();
|
|
36
45
|
expect(getByTestId(targetId).previousElementSibling).toHaveFocus();
|
|
37
|
-
});
|
|
46
|
+
}));
|
|
38
47
|
function TestComponent({ trap = true }) {
|
|
39
48
|
const testRef = (0, useFocusTrap_1.useFocusTrap)(trap);
|
|
40
49
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/hooks",
|
|
3
|
-
"version": "2.6.2
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.js",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@apollo/react-testing": "^4.0.0",
|
|
23
|
-
"@jobber/formatters": "
|
|
23
|
+
"@jobber/formatters": "*",
|
|
24
24
|
"@testing-library/react": "^14.0.0",
|
|
25
25
|
"@testing-library/react-hooks": "^7.0.0",
|
|
26
|
-
"@testing-library/user-event": "^
|
|
26
|
+
"@testing-library/user-event": "^14.5.1",
|
|
27
27
|
"@types/lodash": "4.14.136",
|
|
28
28
|
"@types/react": "^18.0.28",
|
|
29
29
|
"@types/react-dom": "^18.0.11",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"@apollo/client": "^3.0.0",
|
|
46
46
|
"react": "^18"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "1194eb4d0f37470aa801a35ee5b9f0b8f62604c3"
|
|
49
49
|
}
|