@truedat/auth 8.12.2 → 8.12.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/auth",
3
- "version": "8.12.2",
3
+ "version": "8.12.4",
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.2",
57
+ "@truedat/test": "8.12.4",
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.2",
64
+ "@truedat/core": "8.12.4",
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": "b0000f1b2727cad43ce3c3eb2fa29681488dd2ec"
93
+ "gitHead": "d5bc1af84c4d828bdec676b0da58385cf0d6015f"
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 { token, hasPermissions } = useSelector(({ authentication }) => ({
12
- token: authentication.token,
13
- hasPermissions: !_.isEmpty(authentication.entitlements),
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) {
@@ -8,6 +8,8 @@ const renderOpts = {
8
8
  };
9
9
 
10
10
  describe("<EditUser />", () => {
11
+ beforeEach(() => jest.useRealTimers());
12
+
11
13
  it("matches the latest snapshot", async () => {
12
14
  const rendered = render(<EditUser />, renderOpts);
13
15
  await waitForLoad(rendered);
@@ -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 waitFor(() => {
136
- user.type(
137
- rendered.getByLabelText(/user.password.new_password/i, {
138
- selector: "input",
139
- }),
140
- "Va1id.pa$$w0rd!",
141
- );
142
- user.type(
143
- rendered.getByLabelText(/login.form.re_password.label/i, {
144
- selector: "input",
145
- }),
146
- "different",
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(<UserAclRow {...props} />);
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
  });
@@ -10,6 +10,8 @@ const renderOpts = {
10
10
  };
11
11
 
12
12
  describe("<UserForm />", () => {
13
+ beforeEach(() => jest.useRealTimers());
14
+
13
15
  it("matches the latest snapshot", async () => {
14
16
  const rendered = render(<UserForm />, renderOpts);
15
17
  await waitForLoad(rendered);
@@ -2,15 +2,19 @@
2
2
 
3
3
  exports[`<UserAclRow /> matches the latest snapshot 1`] = `
4
4
  <div>
5
- <tr
6
- class=""
7
- >
8
- <td
9
- class=""
10
- />
11
- <td
12
- class=""
13
- />
14
- </tr>
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
  `;