@thepalaceproject/circulation-admin 1.43.0-post.1 → 1.43.0-post.10

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.
Files changed (73) hide show
  1. package/CLAUDE.md +16 -7
  2. package/dist/circulation-admin.js +1 -1
  3. package/eslint.config.mjs +9 -1
  4. package/jest.config.js +56 -9
  5. package/package.json +6 -16
  6. package/tests/jest/actions.test.ts +962 -0
  7. package/tests/jest/components/AccountPage.test.tsx +41 -0
  8. package/tests/jest/components/AdvancedSearchBooleanFilter.test.tsx +231 -0
  9. package/tests/jest/components/AdvancedSearchFilter.test.tsx +142 -0
  10. package/tests/jest/components/AdvancedSearchFilterInput.test.tsx +212 -0
  11. package/tests/jest/components/AdvancedSearchFilterViewer.test.tsx +52 -0
  12. package/tests/jest/components/AdvancedSearchValueFilter.test.tsx +123 -0
  13. package/tests/jest/components/BookDetails.test.tsx +133 -0
  14. package/tests/jest/components/BookDetailsContainer.test.tsx +116 -0
  15. package/tests/jest/components/CatalogServices.test.tsx +63 -0
  16. package/tests/jest/components/CirculationEventsDownloadForm.test.tsx +41 -0
  17. package/tests/jest/components/ConfigPage.test.tsx +58 -0
  18. package/tests/jest/components/CustomListPage.test.tsx +57 -0
  19. package/tests/jest/components/CustomListSearch.test.tsx +275 -0
  20. package/tests/jest/components/CustomListsSidebar.test.tsx +251 -0
  21. package/tests/jest/components/DashboardPage.test.tsx +76 -0
  22. package/tests/jest/components/DebugAuthentication.test.tsx +1 -5
  23. package/tests/jest/components/DiagnosticsTabContainer.test.tsx +147 -0
  24. package/tests/jest/components/EditableConfigList.test.tsx +8 -2
  25. package/tests/jest/components/EntryPointsContainer.test.tsx +97 -0
  26. package/tests/jest/components/EntryPointsTabs.test.tsx +88 -0
  27. package/tests/jest/components/ErrorMessage.test.tsx +97 -0
  28. package/tests/jest/components/Footer.test.tsx +141 -0
  29. package/tests/jest/components/InventoryReportRequestModal.test.tsx +16 -42
  30. package/tests/jest/components/LaneEditor.test.tsx +2 -6
  31. package/tests/jest/components/LanePage.test.tsx +68 -0
  32. package/tests/jest/components/LanguageField.test.tsx +40 -0
  33. package/tests/jest/components/LoadButton.test.tsx +49 -0
  34. package/tests/jest/components/ManagePatrons.test.tsx +73 -0
  35. package/tests/jest/components/ManagePatronsForm.test.tsx +180 -0
  36. package/tests/jest/components/ManagePatronsTabContainer.test.tsx +143 -0
  37. package/tests/jest/components/MetadataServices.test.tsx +59 -0
  38. package/tests/jest/components/PatronBlockingRulesEditor.test.tsx +3 -1
  39. package/tests/jest/components/PatronInfo.test.tsx +54 -0
  40. package/tests/jest/components/SaveButton.test.tsx +47 -0
  41. package/tests/jest/components/SelfTestResult.test.tsx +164 -0
  42. package/tests/jest/components/SelfTestsCategory.test.tsx +200 -0
  43. package/tests/jest/components/ServiceWithRegistrationsEditForm.test.tsx +110 -0
  44. package/tests/jest/components/SetupPage.test.tsx +41 -0
  45. package/tests/jest/components/SingleStatListItem.test.tsx +62 -0
  46. package/tests/jest/components/Stats.test.tsx +4 -8
  47. package/tests/jest/components/TabContainer.test.tsx +68 -0
  48. package/tests/jest/components/Timestamp.test.tsx +74 -0
  49. package/tests/jest/components/TroubleshootingTabContainer.test.tsx +68 -0
  50. package/tests/jest/components/UpdatingLoader.test.tsx +36 -0
  51. package/tests/jest/components/WelcomePage.test.tsx +43 -0
  52. package/tests/jest/components/WithEditButton.test.tsx +55 -0
  53. package/tests/jest/components/WithRemoveButton.test.tsx +95 -0
  54. package/tests/jest/editorAdapter.test.ts +245 -0
  55. package/tests/jest/index.test.tsx +50 -0
  56. package/tests/jest/legacy-setup.ts +13 -0
  57. package/tests/jest/legacyJsdomEnvironment.js +49 -0
  58. package/tests/jest/models/Admin.test.ts +206 -0
  59. package/tests/jest/reducers/bookCoverPreview.test.ts +81 -0
  60. package/tests/jest/reducers/classifications.test.ts +161 -0
  61. package/tests/jest/reducers/collections.test.ts +96 -0
  62. package/tests/jest/reducers/complaints.test.ts +166 -0
  63. package/tests/jest/reducers/createFetchEditReducer.test.ts +220 -0
  64. package/tests/jest/reducers/createRegisterLibraryReducer.test.ts +51 -0
  65. package/tests/jest/reducers/customListDetails.test.ts +120 -0
  66. package/tests/jest/reducers/customListEditor.test.ts +2823 -0
  67. package/tests/jest/reducers/managePatrons.test.ts +71 -0
  68. package/tests/jest/testUtils/formDataShim.test.ts +135 -0
  69. package/tests/jest/testUtils/formDataShim.ts +112 -0
  70. package/tests/jest/utils/sharedFunctions.test.ts +121 -0
  71. package/tsconfig.json +3 -4
  72. package/testReporter.js +0 -29
  73. package/tests/jest/components/AdvancedSearchBuilder.test.tsx +0 -38
@@ -0,0 +1,120 @@
1
+ import customListDetails from "../../../src/reducers/customListDetails";
2
+ import ActionCreator from "../../../src/actions";
3
+
4
+ describe("customListDetails reducer", () => {
5
+ const initState = {
6
+ data: null,
7
+ isFetching: false,
8
+ isEditing: false,
9
+ fetchError: null,
10
+ formError: null,
11
+ responseBody: null,
12
+ successMessage: null,
13
+ isLoaded: false,
14
+ };
15
+
16
+ it("returns initial state for unrecognized action", () => {
17
+ expect(customListDetails(undefined, {})).toStrictEqual(initState);
18
+ });
19
+
20
+ it("handles CUSTOM_LIST_DETAILS_REQUEST", () => {
21
+ const action = {
22
+ type: `${ActionCreator.CUSTOM_LIST_DETAILS}_REQUEST`,
23
+ url: "test url",
24
+ };
25
+
26
+ // start with empty state
27
+ const newState = Object.assign({}, initState, {
28
+ isFetching: true,
29
+ });
30
+ expect(customListDetails(initState, action)).toStrictEqual(newState);
31
+ });
32
+
33
+ it("handles CUSTOM_LIST_DETAILS_MORE_REQUEST", () => {
34
+ const action = {
35
+ type: `${ActionCreator.CUSTOM_LIST_DETAILS_MORE}_REQUEST`,
36
+ url: "test url",
37
+ };
38
+ const oldState = {
39
+ url: "test url",
40
+ data: null,
41
+ isFetching: false,
42
+ isFetchingMoreEntries: false,
43
+ fetchError: null,
44
+ editError: null,
45
+ isLoaded: true,
46
+ isEditing: false,
47
+ };
48
+
49
+ const newState = Object.assign({}, oldState, {
50
+ isFetchingMoreEntries: true,
51
+ isLoaded: false,
52
+ });
53
+
54
+ expect(customListDetails(oldState, action)).toStrictEqual(newState);
55
+ });
56
+
57
+ it("handles CUSTOM_LIST_DETAILS_MORE_LOAD", () => {
58
+ const action = {
59
+ type: `${ActionCreator.CUSTOM_LIST_DETAILS_MORE}_LOAD`,
60
+ data: {
61
+ id: "1",
62
+ url: "url",
63
+ books: [
64
+ { id: "4", title: "4" },
65
+ { id: "5", title: "5" },
66
+ { id: "6", title: "6" },
67
+ ],
68
+ nextPageUrl: "nextpage?after=100",
69
+ navigationLinks: [],
70
+ lanes: [],
71
+ },
72
+ };
73
+ const oldState = {
74
+ url: "test url",
75
+ data: {
76
+ id: "1",
77
+ url: "url",
78
+ title: "custom list",
79
+ books: [
80
+ { id: "1", title: "1" },
81
+ { id: "2", title: "2" },
82
+ { id: "3", title: "3" },
83
+ ],
84
+ nextPageUrl: "nextpage?after=50",
85
+ navigationLinks: [],
86
+ lanes: [],
87
+ },
88
+ isFetching: false,
89
+ isFetchingMoreEntries: false,
90
+ fetchError: null,
91
+ editError: null,
92
+ isLoaded: true,
93
+ isEditing: false,
94
+ };
95
+
96
+ const newState = Object.assign({}, oldState, {
97
+ data: {
98
+ id: "1",
99
+ url: "url",
100
+ title: "custom list",
101
+ books: [
102
+ { id: "1", title: "1" },
103
+ { id: "2", title: "2" },
104
+ { id: "3", title: "3" },
105
+ { id: "4", title: "4" },
106
+ { id: "5", title: "5" },
107
+ { id: "6", title: "6" },
108
+ ],
109
+ nextPageUrl: "nextpage?after=100",
110
+ navigationLinks: [],
111
+ lanes: [],
112
+ },
113
+ isFetching: false,
114
+ isFetchingMoreEntries: false,
115
+ isLoaded: true,
116
+ });
117
+
118
+ expect(customListDetails(oldState, action)).toStrictEqual(newState);
119
+ });
120
+ });