@thepalaceproject/circulation-admin 1.41.0-post.33 → 1.41.0-post.35
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 +3 -2
- package/README.md +1 -1
- package/dist/circulation-admin.js +1 -1
- package/eslint.config.mjs +14 -19
- package/jest.polyfills.js +0 -1
- package/package.json +7 -9
- package/scripts/syncPatronBlockingDocs.js +0 -1
- package/testReporter.js +0 -2
- package/tests/browser/commands/goHome.js +3 -4
- 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 +3 -5
- 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 +1 -3
- package/webpack.dev.config.js +3 -3
- package/webpack.prod.config.js +4 -4
- package/tslint.json +0 -56
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { render, screen
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
3
|
import userEvent from "@testing-library/user-event";
|
|
4
4
|
import { PatronBlockingRulesHelpModal } from "../../../src/components/PatronBlockingRulesHelpModal";
|
|
5
5
|
|
|
@@ -29,9 +29,7 @@ describe("PatronBlockingRulesHelpModal", () => {
|
|
|
29
29
|
|
|
30
30
|
it("does not render when show is false", () => {
|
|
31
31
|
render(<PatronBlockingRulesHelpModal {...baseProps} show={false} />);
|
|
32
|
-
expect(
|
|
33
|
-
screen.queryByText(/Patron Blocking Rules — Help/i)
|
|
34
|
-
).toBeNull();
|
|
32
|
+
expect(screen.queryByText(/Patron Blocking Rules — Help/i)).toBeNull();
|
|
35
33
|
});
|
|
36
34
|
|
|
37
35
|
it("shows a loading indicator when fieldsLoading is true", () => {
|
|
@@ -84,7 +82,9 @@ describe("PatronBlockingRulesHelpModal", () => {
|
|
|
84
82
|
/>
|
|
85
83
|
);
|
|
86
84
|
expect(
|
|
87
|
-
screen.getByText(
|
|
85
|
+
screen.getByText(
|
|
86
|
+
/Save the service before template variables can be fetched/i
|
|
87
|
+
)
|
|
88
88
|
).toBeTruthy();
|
|
89
89
|
expect(screen.queryByText("fines")).toBeNull();
|
|
90
90
|
});
|
|
@@ -97,9 +97,7 @@ describe("PatronBlockingRulesHelpModal", () => {
|
|
|
97
97
|
fieldsError={null}
|
|
98
98
|
/>
|
|
99
99
|
);
|
|
100
|
-
expect(
|
|
101
|
-
screen.getByText(/No field data available/i)
|
|
102
|
-
).toBeTruthy();
|
|
100
|
+
expect(screen.getByText(/No field data available/i)).toBeTruthy();
|
|
103
101
|
});
|
|
104
102
|
|
|
105
103
|
it("renders null values as italic 'null'", () => {
|
|
@@ -6,7 +6,6 @@ import { LibrariesData } from "../../../src/interfaces";
|
|
|
6
6
|
import buildStore from "../../../src/store";
|
|
7
7
|
import { setupServer } from "msw/node";
|
|
8
8
|
import { http, HttpResponse } from "msw";
|
|
9
|
-
import renderWithContext from "../testUtils/renderWithContext";
|
|
10
9
|
import { renderWithProviders } from "../testUtils/withProviders";
|
|
11
10
|
import QuicksightDashboardPage from "../../../src/components/QuicksightDashboardPage";
|
|
12
11
|
|
|
@@ -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: {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* This webpack config establishes a proxy server to enable a local build of circulation-admin to
|
|
5
3
|
* connect to a remote Circulation Manager back-end. Requests for webpack assets are served from
|
|
@@ -87,7 +85,7 @@ module.exports = (env) => {
|
|
|
87
85
|
if (redirectParam) {
|
|
88
86
|
const redirectUrl = new URL(redirectParam);
|
|
89
87
|
|
|
90
|
-
if (redirectUrl.host
|
|
88
|
+
if (redirectUrl.host === backendUrl.host) {
|
|
91
89
|
redirectUrl.protocol = "http";
|
|
92
90
|
redirectUrl.host = requestHost;
|
|
93
91
|
|
package/webpack.dev.config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const { merge } = require(
|
|
2
|
-
const common = require(
|
|
1
|
+
const { merge } = require("webpack-merge");
|
|
2
|
+
const common = require("./webpack.common.js");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const config = merge(common, {
|
|
5
5
|
mode: "development",
|
|
6
6
|
devtool: "eval-source-map",
|
|
7
7
|
});
|
package/webpack.prod.config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const { merge } = require(
|
|
2
|
-
const common = require(
|
|
1
|
+
const { merge } = require("webpack-merge");
|
|
2
|
+
const common = require("./webpack.common.js");
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
mode: "production"
|
|
4
|
+
const config = merge(common, {
|
|
5
|
+
mode: "production",
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
module.exports = config;
|
package/tslint.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["tslint-react-a11y"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"class-name": true,
|
|
5
|
-
"comment-format": [
|
|
6
|
-
true,
|
|
7
|
-
"check-space"
|
|
8
|
-
],
|
|
9
|
-
"indent": [
|
|
10
|
-
true,
|
|
11
|
-
"spaces"
|
|
12
|
-
],
|
|
13
|
-
"no-duplicate-variable": true,
|
|
14
|
-
"no-eval": true,
|
|
15
|
-
"no-internal-module": true,
|
|
16
|
-
"no-trailing-whitespace": true,
|
|
17
|
-
"no-var-keyword": true,
|
|
18
|
-
"one-line": [
|
|
19
|
-
true,
|
|
20
|
-
"check-open-brace",
|
|
21
|
-
"check-whitespace"
|
|
22
|
-
],
|
|
23
|
-
"quotemark": [
|
|
24
|
-
true,
|
|
25
|
-
"double",
|
|
26
|
-
"avoid-escape"
|
|
27
|
-
],
|
|
28
|
-
"semicolon": true,
|
|
29
|
-
"triple-equals": [
|
|
30
|
-
true,
|
|
31
|
-
"allow-null-check"
|
|
32
|
-
],
|
|
33
|
-
"typedef-whitespace": [
|
|
34
|
-
true,
|
|
35
|
-
{
|
|
36
|
-
"call-signature": "nospace",
|
|
37
|
-
"index-signature": "nospace",
|
|
38
|
-
"parameter": "nospace",
|
|
39
|
-
"property-declaration": "nospace",
|
|
40
|
-
"variable-declaration": "nospace"
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"variable-name": [
|
|
44
|
-
true,
|
|
45
|
-
"ban-keywords"
|
|
46
|
-
],
|
|
47
|
-
"whitespace": [
|
|
48
|
-
true,
|
|
49
|
-
"check-branch",
|
|
50
|
-
"check-decl",
|
|
51
|
-
"check-operator",
|
|
52
|
-
"check-separator",
|
|
53
|
-
"check-type"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|