@truedat/auth 8.12.2 → 8.12.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/package.json +4 -4
- package/src/sessions/components/UnauthorizedRoute.js +3 -4
- package/src/users/components/__tests__/EditUser.spec.js +2 -0
- package/src/users/components/__tests__/Password.spec.js +14 -14
- package/src/users/components/__tests__/UserAclRow.spec.js +7 -1
- package/src/users/components/__tests__/UserForm.spec.js +2 -0
- package/src/users/components/__tests__/__snapshots__/UserAclRow.spec.js.snap +14 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/auth",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.5",
|
|
4
4
|
"description": "Truedat Web Auth",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"@testing-library/jest-dom": "^6.6.3",
|
|
55
55
|
"@testing-library/react": "^16.3.0",
|
|
56
56
|
"@testing-library/user-event": "^14.6.1",
|
|
57
|
-
"@truedat/test": "8.12.
|
|
57
|
+
"@truedat/test": "8.12.5",
|
|
58
58
|
"identity-obj-proxy": "^3.0.0",
|
|
59
59
|
"jest": "^29.7.0",
|
|
60
60
|
"redux-saga-test-plan": "^4.0.6"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@apollo/client": "^3.13.8",
|
|
64
|
-
"@truedat/core": "8.12.
|
|
64
|
+
"@truedat/core": "8.12.5",
|
|
65
65
|
"auth0-js": "^10.2.0",
|
|
66
66
|
"axios": "^1.15.0",
|
|
67
67
|
"graphql": "^16.11.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"swr": "^2.3.3"
|
|
91
91
|
},
|
|
92
92
|
"overrides": {},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "71dd08262e6c26dd25466154c49fadb7b3449bd7"
|
|
94
94
|
}
|
|
@@ -8,10 +8,9 @@ import { retrieveToken } from "../routines";
|
|
|
8
8
|
|
|
9
9
|
function UnauthorizedRoute({ component: Component, path = "/" }) {
|
|
10
10
|
const dispatch = useDispatch();
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}));
|
|
11
|
+
const authentication = useSelector((state) => state.authentication);
|
|
12
|
+
const { token } = authentication;
|
|
13
|
+
const hasPermissions = !_.isEmpty(authentication.entitlements);
|
|
15
14
|
|
|
16
15
|
useEffect(() => {
|
|
17
16
|
if (token === undefined) {
|
|
@@ -4,6 +4,8 @@ import { render } from "@truedat/test/render";
|
|
|
4
4
|
import { Password } from "../Password";
|
|
5
5
|
|
|
6
6
|
describe("<Password />", () => {
|
|
7
|
+
beforeEach(() => jest.useRealTimers());
|
|
8
|
+
|
|
7
9
|
const updatePassword = jest.fn();
|
|
8
10
|
|
|
9
11
|
it("matches the latest snapshot", async () => {
|
|
@@ -132,20 +134,18 @@ describe("<Password />", () => {
|
|
|
132
134
|
const rendered = render(<Password {...props} />);
|
|
133
135
|
const user = userEvent.setup({ delay: null });
|
|
134
136
|
|
|
135
|
-
await
|
|
136
|
-
user.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
);
|
|
148
|
-
});
|
|
137
|
+
await user.type(
|
|
138
|
+
rendered.getByLabelText(/user.password.new_password/i, {
|
|
139
|
+
selector: "input",
|
|
140
|
+
}),
|
|
141
|
+
"Va1id.pa$$w0rd!",
|
|
142
|
+
);
|
|
143
|
+
await user.type(
|
|
144
|
+
rendered.getByLabelText(/login.form.re_password.label/i, {
|
|
145
|
+
selector: "input",
|
|
146
|
+
}),
|
|
147
|
+
"different",
|
|
148
|
+
);
|
|
149
149
|
|
|
150
150
|
expect(
|
|
151
151
|
await rendered.findByText(/user.password.must.match/i),
|
|
@@ -9,7 +9,13 @@ describe("<UserAclRow />", () => {
|
|
|
9
9
|
|
|
10
10
|
it("matches the latest snapshot", () => {
|
|
11
11
|
const props = { acl };
|
|
12
|
-
const rendered = render(
|
|
12
|
+
const rendered = render(
|
|
13
|
+
<table>
|
|
14
|
+
<tbody>
|
|
15
|
+
<UserAclRow {...props} />
|
|
16
|
+
</tbody>
|
|
17
|
+
</table>,
|
|
18
|
+
);
|
|
13
19
|
expect(rendered.container).toMatchSnapshot();
|
|
14
20
|
});
|
|
15
21
|
});
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<UserAclRow /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
<table>
|
|
6
|
+
<tbody>
|
|
7
|
+
<tr
|
|
8
|
+
class=""
|
|
9
|
+
>
|
|
10
|
+
<td
|
|
11
|
+
class=""
|
|
12
|
+
/>
|
|
13
|
+
<td
|
|
14
|
+
class=""
|
|
15
|
+
/>
|
|
16
|
+
</tr>
|
|
17
|
+
</tbody>
|
|
18
|
+
</table>
|
|
15
19
|
</div>
|
|
16
20
|
`;
|