@truedat/auth 8.5.6 → 8.5.8

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.5.6",
3
+ "version": "8.5.8",
4
4
  "description": "Truedat Web Auth",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -51,14 +51,14 @@
51
51
  "@testing-library/jest-dom": "^6.6.3",
52
52
  "@testing-library/react": "^16.3.0",
53
53
  "@testing-library/user-event": "^14.6.1",
54
- "@truedat/test": "8.5.6",
54
+ "@truedat/test": "8.5.8",
55
55
  "identity-obj-proxy": "^3.0.0",
56
56
  "jest": "^29.7.0",
57
57
  "redux-saga-test-plan": "^4.0.6"
58
58
  },
59
59
  "dependencies": {
60
60
  "@apollo/client": "^3.13.8",
61
- "@truedat/core": "8.5.6",
61
+ "@truedat/core": "8.5.8",
62
62
  "auth0-js": "^9.28.0",
63
63
  "axios": "^1.15.0",
64
64
  "graphql": "^16.11.0",
@@ -93,5 +93,5 @@
93
93
  "resolutions": {
94
94
  "superagent@npm:^7.1.5": "10.2.3"
95
95
  },
96
- "gitHead": "41e5e6138f5622558bae4151e720c040c4581162"
96
+ "gitHead": "61ad9443b3d822d30dcfa977f5fad3494b3ed5b4"
97
97
  }
@@ -41,6 +41,10 @@ exports[`<Group /> matches the latest snapshot 1`] = `
41
41
  aria-hidden="true"
42
42
  class="ellipsis vertical icon"
43
43
  />
44
+ <i
45
+ aria-hidden="true"
46
+ class="dropdown icon"
47
+ />
44
48
  <div
45
49
  class="left menu transition"
46
50
  >
@@ -25,8 +25,11 @@ export class Auth0LoginButton extends Component {
25
25
  } = this.props;
26
26
 
27
27
  return auth0_config ? (
28
- <a className={`ui button ${color} fluid`} onClick={this.handleLogin}>
29
- <i className={icon} />
28
+ <a
29
+ className={`ui button ${color} fluid td-icon-text-control`}
30
+ onClick={this.handleLogin}
31
+ >
32
+ <i className={icon} aria-hidden="true" />
30
33
  <FormattedMessage id="login.form.actions.auth0" />
31
34
  </a>
32
35
  ) : null;
@@ -7,11 +7,11 @@ import { FormattedMessage } from "react-intl";
7
7
  const toButton = ([method, url], i) => (
8
8
  <a
9
9
  key={i}
10
- className={`ui button ${method}`}
10
+ className={`ui button ${method} td-icon-text-control`}
11
11
  href={url}
12
12
  style={{ marginTop: "12px", marginBottom: "12px" }}
13
13
  >
14
- <i className="sign-in icon" />
14
+ <i className="sign-in icon" aria-hidden="true" />
15
15
  <FormattedMessage id={`login.form.actions.${method}.login`} />
16
16
  </a>
17
17
  );
@@ -22,4 +22,32 @@ describe("<Auth0LoginButton />", () => {
22
22
  rendered.container.querySelector("i.sign-in.icon")
23
23
  ).toBeInTheDocument();
24
24
  });
25
+
26
+ it("renders the shared icon-text class with a decorative custom icon", async () => {
27
+ const props = { auth0_config, icon };
28
+ const rendered = render(<Auth0LoginButton {...props} />);
29
+ const button = rendered.container.querySelector(
30
+ "a.ui.button.yellow.fluid.td-icon-text-control"
31
+ );
32
+ const customIcon = rendered.container.querySelector("i.user.icon");
33
+
34
+ expect(button).toBeInTheDocument();
35
+ expect(button).toHaveTextContent("login.form.actions.auth0");
36
+ expect(customIcon).toBeInTheDocument();
37
+ expect(customIcon).toHaveAttribute("aria-hidden", "true");
38
+ });
39
+
40
+ it("renders the default icon as decorative while keeping the label visible", async () => {
41
+ const props = { auth0_config };
42
+ const rendered = render(<Auth0LoginButton {...props} />);
43
+ const button = rendered.container.querySelector(
44
+ "a.ui.button.yellow.fluid.td-icon-text-control"
45
+ );
46
+ const defaultIcon = rendered.container.querySelector("i.sign-in.icon");
47
+
48
+ expect(button).toBeInTheDocument();
49
+ expect(button).toHaveTextContent("login.form.actions.auth0");
50
+ expect(defaultIcon).toBeInTheDocument();
51
+ expect(defaultIcon).toHaveAttribute("aria-hidden", "true");
52
+ });
25
53
  });
@@ -0,0 +1,26 @@
1
+ import { render } from "@truedat/test/render";
2
+ import { LoginButtons } from "../LoginButtons";
3
+
4
+ describe("<LoginButtons />", () => {
5
+ it("renders auth method buttons with the shared icon-text class", async () => {
6
+ const authMethods = {
7
+ ldap: "https://example.com/login",
8
+ };
9
+ const rendered = render(<LoginButtons authMethods={authMethods} />);
10
+ const button = rendered.container.querySelector(
11
+ "a.ui.button.ldap.td-icon-text-control"
12
+ );
13
+ const icon = button.querySelector("i.sign-in.icon");
14
+
15
+ expect(button).toBeInTheDocument();
16
+ expect(button).toHaveTextContent("login.form.actions.ldap.login");
17
+ expect(icon).toBeInTheDocument();
18
+ expect(icon).toHaveAttribute("aria-hidden", "true");
19
+ });
20
+
21
+ it("renders nothing when auth methods are empty", async () => {
22
+ const rendered = render(<LoginButtons authMethods={{}} />);
23
+
24
+ expect(rendered.container.firstChild).toBeNull();
25
+ });
26
+ });
@@ -3,9 +3,10 @@
3
3
  exports[`<Auth0LoginButton /> matches the latest snapshot with a default icon 1`] = `
4
4
  <div>
5
5
  <a
6
- class="ui button yellow fluid"
6
+ class="ui button yellow fluid td-icon-text-control"
7
7
  >
8
8
  <i
9
+ aria-hidden="true"
9
10
  class="sign-in icon"
10
11
  />
11
12
  login.form.actions.auth0
@@ -16,9 +17,10 @@ exports[`<Auth0LoginButton /> matches the latest snapshot with a default icon 1`
16
17
  exports[`<Auth0LoginButton /> matches the latest snapshot with custom icon 1`] = `
17
18
  <div>
18
19
  <a
19
- class="ui button yellow fluid"
20
+ class="ui button yellow fluid td-icon-text-control"
20
21
  >
21
22
  <i
23
+ aria-hidden="true"
22
24
  class="user icon"
23
25
  />
24
26
  login.form.actions.auth0
@@ -273,7 +273,7 @@ exports[`<EditUser /> matches the latest snapshot 1`] = `
273
273
  actions.save
274
274
  </button>
275
275
  <a
276
- class="ui secondary button"
276
+ class="ui secondary button td-icon-text-control"
277
277
  data-discover="true"
278
278
  href="/"
279
279
  role="button"
@@ -293,7 +293,7 @@ exports[`<InitialUser /> matches the latest snapshot 1`] = `
293
293
  actions.save
294
294
  </button>
295
295
  <a
296
- class="ui secondary button"
296
+ class="ui secondary button td-icon-text-control"
297
297
  data-discover="true"
298
298
  href="/"
299
299
  role="button"
@@ -313,7 +313,7 @@ exports[`<NewUser /> matches the latest snapshot 1`] = `
313
313
  actions.save
314
314
  </button>
315
315
  <a
316
- class="ui secondary button"
316
+ class="ui secondary button td-icon-text-control"
317
317
  data-discover="true"
318
318
  href="/"
319
319
  role="button"
@@ -105,7 +105,7 @@ exports[`<Password /> matches the latest snapshot 1`] = `
105
105
  class="actions"
106
106
  >
107
107
  <a
108
- class="ui secondary button"
108
+ class="ui secondary button td-icon-text-control"
109
109
  data-discover="true"
110
110
  href="/"
111
111
  role="button"
@@ -63,13 +63,17 @@ exports[`<User /> matches the latest snapshot 1`] = `
63
63
  aria-hidden="true"
64
64
  class="ellipsis vertical icon"
65
65
  />
66
+ <i
67
+ aria-hidden="true"
68
+ class="dropdown icon"
69
+ />
66
70
  <div
67
71
  class="left menu transition"
68
72
  >
69
73
  <a
70
74
  aria-checked="false"
71
75
  aria-selected="false"
72
- class="item"
76
+ class="item td-icon-text-control"
73
77
  data-discover="true"
74
78
  href="/users/1/edit"
75
79
  role="option"
@@ -84,7 +88,7 @@ exports[`<User /> matches the latest snapshot 1`] = `
84
88
  <a
85
89
  aria-checked="false"
86
90
  aria-selected="false"
87
- class="item"
91
+ class="item td-icon-text-control"
88
92
  data-discover="true"
89
93
  href="/users/1/password"
90
94
  role="option"
@@ -12,13 +12,17 @@ exports[`<UserActions /> matches the latest snapshot 1`] = `
12
12
  aria-hidden="true"
13
13
  class="ellipsis vertical icon"
14
14
  />
15
+ <i
16
+ aria-hidden="true"
17
+ class="dropdown icon"
18
+ />
15
19
  <div
16
20
  class="left menu transition"
17
21
  >
18
22
  <a
19
23
  aria-checked="false"
20
24
  aria-selected="false"
21
- class="item"
25
+ class="item td-icon-text-control"
22
26
  data-discover="true"
23
27
  href="/users/2/edit"
24
28
  role="option"
@@ -33,7 +37,7 @@ exports[`<UserActions /> matches the latest snapshot 1`] = `
33
37
  <a
34
38
  aria-checked="false"
35
39
  aria-selected="false"
36
- class="item"
40
+ class="item td-icon-text-control"
37
41
  data-discover="true"
38
42
  href="/users/2/password"
39
43
  role="option"
@@ -19,9 +19,11 @@ exports[`<UserDomainsFilter /> matches the latest snapshot 1`] = `
19
19
  role="listbox"
20
20
  tabindex="0"
21
21
  >
22
- <label>
22
+ <div
23
+ class="default text"
24
+ >
23
25
  domain.multiple.placeholder
24
- </label>
26
+ </div>
25
27
  <i
26
28
  aria-hidden="true"
27
29
  class="dropdown icon"
@@ -277,7 +277,7 @@ exports[`<UserForm /> matches the latest snapshot 1`] = `
277
277
  actions.save
278
278
  </button>
279
279
  <a
280
- class="ui secondary button"
280
+ class="ui secondary button td-icon-text-control"
281
281
  data-discover="true"
282
282
  href="/"
283
283
  role="button"
@@ -101,7 +101,7 @@ exports[`<UserPassword /> matches the latest snapshot 1`] = `
101
101
  class="actions"
102
102
  >
103
103
  <a
104
- class="ui secondary button"
104
+ class="ui secondary button td-icon-text-control"
105
105
  data-discover="true"
106
106
  href="/"
107
107
  role="button"