@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
@@ -151,5 +151,5 @@
151
151
  "*.{js,jsx,ts,tsx,css,md}": "prettier --write",
152
152
  "*.{js,css,md}": "prettier --write"
153
153
  },
154
- "version": "1.31.0-post.2"
154
+ "version": "1.31.0-post.3"
155
155
  }
@@ -6,7 +6,8 @@ import {
6
6
  useAppFeatureFlags,
7
7
  useCsrfToken,
8
8
  useTermsOfService,
9
- useSupportContactUrl,
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 expectedSupportContactUrl = "helpdesk@example.com";
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: expectedSupportContactUrl,
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.support_contact_url).toEqual(expectedSupportContactUrl);
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 useSupportContactUrl context hook", () => {
98
- const { result } = renderHook(() => useSupportContactUrl(), {
103
+ it("provides useSupportContact context hook", () => {
104
+ const { result } = renderHook(() => useSupportContact(), {
99
105
  wrapper,
100
106
  });
101
- const supportContactUrl = result.current;
102
- expect(supportContactUrl).toEqual(expectedSupportContactUrl);
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
  });