@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 +4 -4
- package/src/groups/components/__tests__/__snapshots__/Group.spec.js.snap +4 -0
- package/src/sessions/components/Auth0LoginButton.js +5 -2
- package/src/sessions/components/LoginButtons.js +2 -2
- package/src/sessions/components/__tests__/Auth0LoginButton.spec.js +28 -0
- package/src/sessions/components/__tests__/LoginButtons.spec.js +26 -0
- package/src/sessions/components/__tests__/__snapshots__/Auth0LoginButton.spec.js.snap +4 -2
- package/src/users/components/__tests__/__snapshots__/EditUser.spec.js.snap +1 -1
- package/src/users/components/__tests__/__snapshots__/InitialUser.spec.js.snap +1 -1
- package/src/users/components/__tests__/__snapshots__/NewUser.spec.js.snap +1 -1
- package/src/users/components/__tests__/__snapshots__/Password.spec.js.snap +1 -1
- package/src/users/components/__tests__/__snapshots__/User.spec.js.snap +6 -2
- package/src/users/components/__tests__/__snapshots__/UserActions.spec.js.snap +6 -2
- package/src/users/components/__tests__/__snapshots__/UserDomainsFilter.spec.js.snap +4 -2
- package/src/users/components/__tests__/__snapshots__/UserForm.spec.js.snap +1 -1
- package/src/users/components/__tests__/__snapshots__/UserPassword.spec.js.snap +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/auth",
|
|
3
|
-
"version": "8.5.
|
|
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.
|
|
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.
|
|
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": "
|
|
96
|
+
"gitHead": "61ad9443b3d822d30dcfa977f5fad3494b3ed5b4"
|
|
97
97
|
}
|
|
@@ -25,8 +25,11 @@ export class Auth0LoginButton extends Component {
|
|
|
25
25
|
} = this.props;
|
|
26
26
|
|
|
27
27
|
return auth0_config ? (
|
|
28
|
-
<a
|
|
29
|
-
|
|
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
|
|
@@ -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
|
-
<
|
|
22
|
+
<div
|
|
23
|
+
class="default text"
|
|
24
|
+
>
|
|
23
25
|
domain.multiple.placeholder
|
|
24
|
-
</
|
|
26
|
+
</div>
|
|
25
27
|
<i
|
|
26
28
|
aria-hidden="true"
|
|
27
29
|
class="dropdown icon"
|