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

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 (94) 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/Announcement.test.tsx +76 -0
  14. package/tests/jest/components/Autocomplete.test.tsx +67 -0
  15. package/tests/jest/components/BookDetails.test.tsx +133 -0
  16. package/tests/jest/components/BookDetailsContainer.test.tsx +116 -0
  17. package/tests/jest/components/BookDetailsEditor.test.tsx +275 -0
  18. package/tests/jest/components/BookEditForm.test.tsx +352 -0
  19. package/tests/jest/components/CatalogServices.test.tsx +63 -0
  20. package/tests/jest/components/CirculationEventsDownloadForm.test.tsx +41 -0
  21. package/tests/jest/components/Classifications.test.tsx +166 -0
  22. package/tests/jest/components/ClassificationsTable.test.tsx +57 -0
  23. package/tests/jest/components/ColorPicker.test.tsx +58 -0
  24. package/tests/jest/components/ComplaintForm.test.tsx +171 -0
  25. package/tests/jest/components/Complaints.test.tsx +259 -0
  26. package/tests/jest/components/ConfigPage.test.tsx +58 -0
  27. package/tests/jest/components/ContextProvider.test.tsx +138 -0
  28. package/tests/jest/components/CustomListEditor.test.tsx +367 -0
  29. package/tests/jest/components/CustomListPage.test.tsx +57 -0
  30. package/tests/jest/components/CustomListSearch.test.tsx +275 -0
  31. package/tests/jest/components/CustomListsForBook.test.tsx +315 -0
  32. package/tests/jest/components/CustomListsSidebar.test.tsx +251 -0
  33. package/tests/jest/components/DashboardPage.test.tsx +76 -0
  34. package/tests/jest/components/DebugAuthentication.test.tsx +1 -5
  35. package/tests/jest/components/DiagnosticsServiceTabs.test.tsx +141 -0
  36. package/tests/jest/components/DiagnosticsServiceType.test.tsx +75 -0
  37. package/tests/jest/components/DiagnosticsTabContainer.test.tsx +147 -0
  38. package/tests/jest/components/EditableConfigList.test.tsx +8 -2
  39. package/tests/jest/components/EntryPointsContainer.test.tsx +97 -0
  40. package/tests/jest/components/EntryPointsTabs.test.tsx +88 -0
  41. package/tests/jest/components/ErrorMessage.test.tsx +97 -0
  42. package/tests/jest/components/Footer.test.tsx +141 -0
  43. package/tests/jest/components/InventoryReportRequestModal.test.tsx +16 -42
  44. package/tests/jest/components/LaneEditor.test.tsx +2 -6
  45. package/tests/jest/components/LanePage.test.tsx +68 -0
  46. package/tests/jest/components/LanguageField.test.tsx +40 -0
  47. package/tests/jest/components/LibraryEditForm.test.tsx +383 -0
  48. package/tests/jest/components/LibraryRegistrationForm.test.tsx +203 -0
  49. package/tests/jest/components/LoadButton.test.tsx +49 -0
  50. package/tests/jest/components/ManagePatrons.test.tsx +73 -0
  51. package/tests/jest/components/ManagePatronsForm.test.tsx +180 -0
  52. package/tests/jest/components/ManagePatronsTabContainer.test.tsx +143 -0
  53. package/tests/jest/components/MetadataServices.test.tsx +59 -0
  54. package/tests/jest/components/PatronAuthServices.test.tsx +114 -0
  55. package/tests/jest/components/PatronBlockingRulesEditor.test.tsx +3 -1
  56. package/tests/jest/components/PatronInfo.test.tsx +54 -0
  57. package/tests/jest/components/ResetAdobeId.test.tsx +302 -0
  58. package/tests/jest/components/SaveButton.test.tsx +47 -0
  59. package/tests/jest/components/SelfTestResult.test.tsx +164 -0
  60. package/tests/jest/components/SelfTestsCategory.test.tsx +200 -0
  61. package/tests/jest/components/ServiceWithRegistrationsEditForm.test.tsx +110 -0
  62. package/tests/jest/components/SetupPage.test.tsx +41 -0
  63. package/tests/jest/components/SingleStatListItem.test.tsx +62 -0
  64. package/tests/jest/components/SitewideAnnouncements.test.tsx +134 -0
  65. package/tests/jest/components/Stats.test.tsx +4 -8
  66. package/tests/jest/components/TabContainer.test.tsx +68 -0
  67. package/tests/jest/components/Timestamp.test.tsx +74 -0
  68. package/tests/jest/components/TroubleshootingCategoryPage.test.tsx +69 -0
  69. package/tests/jest/components/TroubleshootingPage.test.tsx +94 -0
  70. package/tests/jest/components/TroubleshootingTabContainer.test.tsx +68 -0
  71. package/tests/jest/components/UpdatingLoader.test.tsx +36 -0
  72. package/tests/jest/components/WelcomePage.test.tsx +43 -0
  73. package/tests/jest/components/WithEditButton.test.tsx +55 -0
  74. package/tests/jest/components/WithRemoveButton.test.tsx +95 -0
  75. package/tests/jest/editorAdapter.test.ts +245 -0
  76. package/tests/jest/index.test.tsx +50 -0
  77. package/tests/jest/legacy-setup.ts +13 -0
  78. package/tests/jest/legacyJsdomEnvironment.js +49 -0
  79. package/tests/jest/models/Admin.test.ts +206 -0
  80. package/tests/jest/reducers/bookCoverPreview.test.ts +81 -0
  81. package/tests/jest/reducers/classifications.test.ts +161 -0
  82. package/tests/jest/reducers/collections.test.ts +96 -0
  83. package/tests/jest/reducers/complaints.test.ts +166 -0
  84. package/tests/jest/reducers/createFetchEditReducer.test.ts +220 -0
  85. package/tests/jest/reducers/createRegisterLibraryReducer.test.ts +51 -0
  86. package/tests/jest/reducers/customListDetails.test.ts +120 -0
  87. package/tests/jest/reducers/customListEditor.test.ts +2823 -0
  88. package/tests/jest/reducers/managePatrons.test.ts +71 -0
  89. package/tests/jest/testUtils/formDataShim.test.ts +135 -0
  90. package/tests/jest/testUtils/formDataShim.ts +112 -0
  91. package/tests/jest/utils/sharedFunctions.test.ts +121 -0
  92. package/tsconfig.json +3 -4
  93. package/testReporter.js +0 -29
  94. package/tests/jest/components/AdvancedSearchBuilder.test.tsx +0 -38
package/eslint.config.mjs CHANGED
@@ -8,7 +8,15 @@ import globals from "globals";
8
8
 
9
9
  export default tseslint.config(
10
10
  {
11
- ignores: ["dist/", "lib/", "docs/", "typings/", "node_modules/"],
11
+ ignores: [
12
+ "dist/",
13
+ "lib/",
14
+ "docs/",
15
+ "typings/",
16
+ "node_modules/",
17
+ "coverage/",
18
+ ".nyc_output/",
19
+ ],
12
20
  },
13
21
  js.configs.recommended,
14
22
  ...tseslint.configs.recommended,
package/jest.config.js CHANGED
@@ -1,16 +1,63 @@
1
1
  /** @type {import('ts-jest').JestConfigWithTsJest} */
2
- module.exports = {
2
+
3
+ // Options shared by both projects.
4
+ const sharedProjectConfig = {
5
+ preset: "ts-jest",
6
+ testEnvironmentOptions: {
7
+ // Without this, jsdom's default `["browser"]` export condition resolves sinon
8
+ // to its ESM bundle, which ts-jest does not transform. Every legacy suite then
9
+ // dies with `SyntaxError: Unexpected token 'export'`.
10
+ customExportConditions: [""],
11
+ },
12
+ setupFiles: ["<rootDir>/jest.polyfills.js"],
3
13
  moduleNameMapper: {
4
14
  "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
5
15
  "<rootDir>/tests/__mocks__/fileMock.js",
6
- "\\.(css|less)$": "<rootDir>/tests/__mocks__/styleMock.js",
16
+ "\\.(css|less|scss|sass)$": "<rootDir>/tests/__mocks__/styleMock.js",
7
17
  "\\.md$": "<rootDir>/tests/__mocks__/fileMock.js",
8
18
  },
9
- preset: "ts-jest",
10
- testEnvironment: "jest-fixed-jsdom",
11
- testEnvironmentOptions: {
12
- customExportConditions: [""],
13
- },
14
- setupFiles: ["./jest.polyfills.js"],
15
- setupFilesAfterEnv: ["./tests/jest/jest-setup.ts"],
19
+ // `src` must stay in `roots` so that `collectCoverageFrom` can discover source
20
+ // files that no test imports — otherwise they are silently omitted from the
21
+ // report rather than counted as uncovered, and the coverage percentage rises
22
+ // while real coverage is unchanged.
23
+ roots: ["<rootDir>/src"],
24
+ };
25
+
26
+ module.exports = {
27
+ coverageDirectory: "coverage/jest",
28
+ coverageReporters: ["lcov", "text-summary"],
29
+ // Must live at the top level, not inside `projects`: jest reads
30
+ // `collectCoverageFrom` off the *global* config. Set it only per-project and it
31
+ // is silently undefined globally, so every executed file gets instrumented —
32
+ // including test helpers and everything under `tests/`.
33
+ collectCoverageFrom: [
34
+ "src/**/*.{ts,tsx}",
35
+ "!src/**/__tests__/**",
36
+ "!src/**/*.d.ts",
37
+ ],
38
+ projects: [
39
+ {
40
+ ...sharedProjectConfig,
41
+ displayName: "unit",
42
+ roots: [...sharedProjectConfig.roots, "<rootDir>/tests/jest"],
43
+ testMatch: ["<rootDir>/tests/jest/**/*.test.{js,jsx,ts,tsx}"],
44
+ // `jest-fixed-jsdom` restores Node's fetch/Response globals so MSW can
45
+ // intercept them.
46
+ testEnvironment: "jest-fixed-jsdom",
47
+ setupFilesAfterEnv: ["<rootDir>/tests/jest/jest-setup.ts"],
48
+ },
49
+ {
50
+ // Legacy enzyme + chai + sinon tests, still in `src/**/__tests__/`. They are
51
+ // being rewritten as React Testing Library tests under `tests/jest/`; when the
52
+ // last one is gone, delete this project, its environment, and its setup file.
53
+ //
54
+ // These cannot use `jest-fixed-jsdom`: it swaps in undici's `FormData`, which
55
+ // rejects `new FormData(formElement)` and crashes any test that submits a form.
56
+ ...sharedProjectConfig,
57
+ displayName: "legacy",
58
+ testMatch: ["<rootDir>/src/**/__tests__/*-test.{ts,tsx}"],
59
+ testEnvironment: "<rootDir>/tests/jest/legacyJsdomEnvironment.js",
60
+ setupFilesAfterEnv: ["<rootDir>/tests/jest/legacy-setup.ts"],
61
+ },
62
+ ],
16
63
  };
package/package.json CHANGED
@@ -17,18 +17,15 @@
17
17
  "prepublish": "npm run prod",
18
18
  "lint": "npm run lint:js && sass-lint -c .sass-lint.yml -v -q",
19
19
  "lint:js": "eslint . --max-warnings 0",
20
- "test-js": "tsc && cp -r src/stylesheets lib && cp -r src/images lib && mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js",
21
- "test-js-file": "tsc && cp -r src/stylesheets lib && cp -r src/images lib && mocha --require lib/testHelper.js",
22
- "test-js-list": "mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js --reporter ./testReporter.js",
23
- "test-ts": "mocha -r ts-node/register --require src/testHelper.ts src/__tests__/*.ts* src/**/__tests__/*.ts* src/**/**/__tests__/*.ts*",
24
- "test-file-ts": "mocha -r ts-node/register --require src/testHelper.ts",
25
- "test": "npm run test-ts && npm run test-jest",
26
- "test-file": "npm run test-file-ts",
20
+ "test": "npm run test-jest",
21
+ "test-file": "npm run test-jest-file",
27
22
  "test-browser": "npm run test-chrome && npm run test-firefox",
28
23
  "test-chrome": "node_modules/.bin/selenium-standalone install && nightwatch -e chrome",
29
24
  "test-firefox": "node_modules/.bin/selenium-standalone install && nightwatch -e firefox",
30
- "test-jest": "jest --verbose --roots tests/jest",
25
+ "test-jest": "jest --verbose",
31
26
  "test-jest-file": "jest --verbose",
27
+ "coverage": "npm run coverage-jest",
28
+ "coverage-jest": "npm run test-jest -- --coverage",
32
29
  "dev": "webpack --watch --progress --config webpack.dev.config",
33
30
  "dev-server": "dotenv -c -- webpack serve --progress --hot --config webpack.dev-server.config",
34
31
  "dev-test-axe": "TEST_AXE=true npm run dev",
@@ -78,7 +75,6 @@
78
75
  "@testing-library/react-hooks": "^8.0.1",
79
76
  "@testing-library/user-event": "^14.4.3",
80
77
  "@types/jest": "^29.2.6",
81
- "@types/mocha": "^10.0.1",
82
78
  "@types/node": "^25.9.3",
83
79
  "@types/numeral": "^2.0.5",
84
80
  "@types/prop-types": "^15.7.3",
@@ -90,7 +86,6 @@
90
86
  "@types/redux-mock-store": "^1.0.3",
91
87
  "chai": "4.2.0",
92
88
  "clean-webpack-plugin": "^2.0.1",
93
- "colors-cli": "^1.0.27",
94
89
  "copy-webpack-plugin": "14.0.0",
95
90
  "css-loader": "^7.1.4",
96
91
  "dotenv-cli": "^11.0.0",
@@ -101,7 +96,6 @@
101
96
  "eslint-plugin-jsx-a11y": "^6.10.2",
102
97
  "eslint-plugin-react": "^7.37.5",
103
98
  "eslint-plugin-react-hooks": "^7.1.1",
104
- "fetch-mock": "^10.0.7",
105
99
  "fetch-mock-jest": "^1.5.1",
106
100
  "fetch-ponyfill": "^7.1.0",
107
101
  "file-loader": "^6.2.0",
@@ -111,17 +105,14 @@
111
105
  "jest": "^29.3.1",
112
106
  "jest-environment-jsdom": "^30.4.1",
113
107
  "jest-fixed-jsdom": "^0.0.11",
114
- "jsdom": "^29.1.1",
115
108
  "json-loader": "^0.5.4",
116
109
  "lint-staged": "^17.0.7",
117
110
  "marked": "^18.0.5",
118
111
  "mini-css-extract-plugin": "1.6.0",
119
- "mocha": "^11.7.6",
120
112
  "msw": "^2.7.3",
121
113
  "nightwatch": "^3.14.0",
122
114
  "prettier": "3.8.4",
123
115
  "react-axe": "^3.3.0",
124
- "react-test-renderer": "^16.14.0",
125
116
  "redux-mock-store": "^1.5.4",
126
117
  "resize-observer-polyfill": "^1.5.1",
127
118
  "sass": "^1.64.2",
@@ -133,7 +124,6 @@
133
124
  "terser-webpack-plugin": "^5.3.6",
134
125
  "ts-jest": "^29.2.6",
135
126
  "ts-loader": "^9.5.2",
136
- "ts-node": "^10.9.2",
137
127
  "typedoc": "^0.28.19",
138
128
  "typescript": "^5.7.3",
139
129
  "typescript-eslint": "^8.60.1",
@@ -153,5 +143,5 @@
153
143
  "*.{js,jsx,ts,tsx,css,md}": "prettier --write",
154
144
  "*.{js,css,md}": "prettier --write"
155
145
  },
156
- "version": "1.43.0-post.1"
146
+ "version": "1.43.0-post.11"
157
147
  }