@thepalaceproject/circulation-admin 1.31.0-post.2 → 1.31.0-post.3
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
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
useAppFeatureFlags,
|
|
7
7
|
useCsrfToken,
|
|
8
8
|
useTermsOfService,
|
|
9
|
-
|
|
9
|
+
useSupportContact,
|
|
10
|
+
SupportContactLink,
|
|
10
11
|
} from "../../../src/context/appContext";
|
|
11
12
|
import { componentWithProviders } from "../testUtils/withProviders";
|
|
12
13
|
import {
|
|
@@ -34,7 +35,11 @@ describe("AppContext", () => {
|
|
|
34
35
|
text: "Terms of Service",
|
|
35
36
|
href: "/terms-of-service",
|
|
36
37
|
};
|
|
37
|
-
const
|
|
38
|
+
const emailAddress = "helpdesk@example.com";
|
|
39
|
+
const expectedSupportContact: SupportContactLink = {
|
|
40
|
+
href: `mailto:${emailAddress}?subject=Support+request`,
|
|
41
|
+
text: `Email ${emailAddress}.`,
|
|
42
|
+
};
|
|
38
43
|
|
|
39
44
|
const appConfigSettings: Partial<ConfigurationSettings> = {
|
|
40
45
|
csrfToken: expectedCsrfToken,
|
|
@@ -43,7 +48,8 @@ describe("AppContext", () => {
|
|
|
43
48
|
email: expectedEmail,
|
|
44
49
|
tos_link_text: expectedTermsOfService.text,
|
|
45
50
|
tos_link_href: expectedTermsOfService.href,
|
|
46
|
-
support_contact_url:
|
|
51
|
+
support_contact_url: "deprecated and should be overridden",
|
|
52
|
+
supportContactUrl: expectedSupportContact.href,
|
|
47
53
|
};
|
|
48
54
|
const wrapper = componentWithProviders({ appConfigSettings });
|
|
49
55
|
|
|
@@ -54,7 +60,7 @@ describe("AppContext", () => {
|
|
|
54
60
|
expect(value.admin.email).toEqual(expectedEmail);
|
|
55
61
|
expect(value.admin.roles).toEqual(expectedRoles);
|
|
56
62
|
expect(value.featureFlags).toEqual(expectedFeatureFlags);
|
|
57
|
-
expect(value.
|
|
63
|
+
expect(value.supportContact).toEqual(expectedSupportContact);
|
|
58
64
|
});
|
|
59
65
|
|
|
60
66
|
it("provides useAppAdmin context hook", () => {
|
|
@@ -94,11 +100,14 @@ describe("AppContext", () => {
|
|
|
94
100
|
expect(text).toEqual(expectedTermsOfService.text);
|
|
95
101
|
expect(href).toEqual(expectedTermsOfService.href);
|
|
96
102
|
});
|
|
97
|
-
it("provides
|
|
98
|
-
const { result } = renderHook(() =>
|
|
103
|
+
it("provides useSupportContact context hook", () => {
|
|
104
|
+
const { result } = renderHook(() => useSupportContact(), {
|
|
99
105
|
wrapper,
|
|
100
106
|
});
|
|
101
|
-
const
|
|
102
|
-
expect(
|
|
107
|
+
const supportContact = result.current;
|
|
108
|
+
expect(supportContact).toBeDefined();
|
|
109
|
+
const { href, text } = supportContact;
|
|
110
|
+
expect(href).toEqual(expectedSupportContact.href);
|
|
111
|
+
expect(text).toEqual(expectedSupportContact.text);
|
|
103
112
|
});
|
|
104
113
|
});
|