@thepalaceproject/circulation-admin 1.41.0-post.33 → 1.41.0-post.34
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/CLAUDE.md +2 -1
- package/dist/circulation-admin.js +1 -1
- package/eslint.config.mjs +11 -19
- package/jest.polyfills.js +0 -1
- package/package.json +2 -1
- package/scripts/syncPatronBlockingDocs.js +0 -1
- package/testReporter.js +0 -2
- package/tests/browser/navigate.js +114 -124
- package/tests/browser/redirect.js +26 -41
- package/tests/jest/components/AdvancedSearchBuilder.test.tsx +1 -1
- package/tests/jest/components/CustomLists.test.tsx +0 -1
- package/tests/jest/components/DebugAuthentication.test.tsx +0 -2
- package/tests/jest/components/InventoryReportRequestModal.test.tsx +0 -2
- package/tests/jest/components/JsonField.test.tsx +0 -1
- package/tests/jest/components/LaneEditor.test.tsx +1 -1
- package/tests/jest/components/PatronBlockingRulesHelpModal.test.tsx +6 -8
- package/tests/jest/components/QuicksightDashboard.test.tsx +0 -1
- package/tests/jest/components/Stats.test.tsx +7 -13
- package/tests/jest/features/book.test.ts +2 -7
- package/webpack.common.js +0 -2
- package/webpack.dev-server.config.js +0 -2
|
@@ -21,11 +21,7 @@ import { renderHook } from "@testing-library/react-hooks";
|
|
|
21
21
|
import { FetchErrorData } from "@thepalaceproject/web-opds-client/lib/interfaces";
|
|
22
22
|
import { store } from "../../../src/store";
|
|
23
23
|
import { api } from "../../../src/features/api/apiSlice";
|
|
24
|
-
import {
|
|
25
|
-
AdminRoleData,
|
|
26
|
-
ConfigurationSettings,
|
|
27
|
-
RolesData,
|
|
28
|
-
} from "../../../src/interfaces";
|
|
24
|
+
import { AdminRoleData, ConfigurationSettings } from "../../../src/interfaces";
|
|
29
25
|
|
|
30
26
|
const normalizedData = normalizeStatistics(statisticsApiResponseData);
|
|
31
27
|
|
|
@@ -442,14 +438,12 @@ describe("Dashboard Statistics", () => {
|
|
|
442
438
|
roles,
|
|
443
439
|
quicksightPagePath: fakeQuickSightHref,
|
|
444
440
|
};
|
|
445
|
-
const {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
appConfigSettings,
|
|
452
|
-
});
|
|
441
|
+
const { container, getByRole, queryByRole } = renderWithProviders(
|
|
442
|
+
<Stats library={sampleLibraryKey} />,
|
|
443
|
+
{
|
|
444
|
+
appConfigSettings,
|
|
445
|
+
}
|
|
446
|
+
);
|
|
453
447
|
|
|
454
448
|
// We should always render a Usage reports group when a library is specified.
|
|
455
449
|
getByRole("heading", {
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import reducer, {
|
|
2
2
|
initialState,
|
|
3
3
|
getBookData,
|
|
4
|
-
GetBookDataArgs,
|
|
5
4
|
submitBookData,
|
|
6
5
|
} from "../../../src/features/book/bookEditorSlice";
|
|
7
6
|
import { expect } from "chai";
|
|
8
7
|
import * as fetchMock from "fetch-mock-jest";
|
|
9
|
-
import { store } from "../../../src/store";
|
|
10
8
|
import { BookData } from "@thepalaceproject/web-opds-client/lib/interfaces";
|
|
11
9
|
import { RequestError } from "@thepalaceproject/web-opds-client/lib/DataFetcher";
|
|
12
|
-
import { AsyncThunkAction, Dispatch } from "@reduxjs/toolkit";
|
|
13
10
|
import ActionCreator from "@thepalaceproject/web-opds-client/lib/actions";
|
|
14
11
|
|
|
15
12
|
const SAMPLE_BOOK_ADMIN_DETAIL = `
|
|
@@ -274,8 +271,6 @@ describe("Redux bookEditorSlice...", () => {
|
|
|
274
271
|
describe("submitBookData...", () => {
|
|
275
272
|
const goodBookUrl = "https://example.com/book";
|
|
276
273
|
const editBookUrl = `${goodBookUrl}/edit`;
|
|
277
|
-
const brokenBookUrl = "https://example.com/broken-book";
|
|
278
|
-
const errorBookUrl = "https://example.com/error-book";
|
|
279
274
|
const csrfTokenHeader = "X-CSRF-Token";
|
|
280
275
|
const validCsrfToken = "valid-csrf-token";
|
|
281
276
|
|
|
@@ -328,7 +323,7 @@ describe("Redux bookEditorSlice...", () => {
|
|
|
328
323
|
csrfToken,
|
|
329
324
|
});
|
|
330
325
|
|
|
331
|
-
|
|
326
|
+
await action(dispatch, getState, undefined);
|
|
332
327
|
const dispatchCalls = dispatch.mock.calls;
|
|
333
328
|
const fetchCalls = fetchMock.calls();
|
|
334
329
|
|
|
@@ -366,7 +361,7 @@ describe("Redux bookEditorSlice...", () => {
|
|
|
366
361
|
csrfToken,
|
|
367
362
|
});
|
|
368
363
|
|
|
369
|
-
|
|
364
|
+
await action(dispatch, getState, undefined);
|
|
370
365
|
const dispatchCalls = dispatch.mock.calls;
|
|
371
366
|
const fetchCalls = fetchMock.calls();
|
|
372
367
|
|
package/webpack.common.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
1
|
const path = require("path");
|
|
3
2
|
const CleanWebpackPlugin = require("clean-webpack-plugin");
|
|
4
3
|
const webpack = require("webpack");
|
|
5
4
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
6
5
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
7
6
|
const CopyPlugin = require("copy-webpack-plugin");
|
|
8
|
-
/* eslint-enable @typescript-eslint/no-var-requires */
|
|
9
7
|
|
|
10
8
|
module.exports = {
|
|
11
9
|
entry: {
|