@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
package/eslint.config.mjs
CHANGED
|
@@ -14,6 +14,15 @@ export default tseslint.config(
|
|
|
14
14
|
...tseslint.configs.recommended,
|
|
15
15
|
react.configs.flat.recommended,
|
|
16
16
|
jsxA11y.flatConfigs.strict,
|
|
17
|
+
{
|
|
18
|
+
// Global so react rules can detect the version everywhere they run,
|
|
19
|
+
// including config files outside the files filter below.
|
|
20
|
+
settings: {
|
|
21
|
+
react: {
|
|
22
|
+
version: "detect",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
17
26
|
{
|
|
18
27
|
files: ["**/*.{js,jsx,ts,tsx}"],
|
|
19
28
|
plugins: {
|
|
@@ -28,11 +37,6 @@ export default tseslint.config(
|
|
|
28
37
|
...globals.jest,
|
|
29
38
|
},
|
|
30
39
|
},
|
|
31
|
-
settings: {
|
|
32
|
-
react: {
|
|
33
|
-
version: "detect",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
40
|
rules: {
|
|
37
41
|
// Enable the two classic react-hooks rules explicitly rather than
|
|
38
42
|
// spreading `reactHooks.configs.recommended.rules`. eslint-plugin-react-hooks
|
|
@@ -78,18 +82,6 @@ export default tseslint.config(
|
|
|
78
82
|
},
|
|
79
83
|
},
|
|
80
84
|
// Disable ESLint formatting rules that conflict with Prettier.
|
|
81
|
-
// This should be
|
|
82
|
-
prettier
|
|
83
|
-
{
|
|
84
|
-
// ESLint merges `linterOptions` with last-writer-wins
|
|
85
|
-
// semantics, so placing it after every preset spread keeps a future plugin
|
|
86
|
-
// config from silently re-enabling it. Flat config reports unused
|
|
87
|
-
// eslint-disable directives by default; the previous .eslintrc setup did
|
|
88
|
-
// not. Keep it off to preserve prior behavior and avoid the pre-commit hook
|
|
89
|
-
// auto-stripping existing directives. Cleaning up stale directives can be
|
|
90
|
-
// done as a separate, focused change.
|
|
91
|
-
linterOptions: {
|
|
92
|
-
reportUnusedDisableDirectives: "off",
|
|
93
|
-
},
|
|
94
|
-
}
|
|
85
|
+
// This should be the last option so it overrides previous rules.
|
|
86
|
+
prettier
|
|
95
87
|
);
|
package/jest.polyfills.js
CHANGED
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"prepublish": "npm run prod",
|
|
17
17
|
"lint": "tslint -c tslint.json src/*.ts src/*.tsx src/**/*.ts src/**/*.tsx src/**/**/*.ts src/**/**/*.tsx && sass-lint -c .sass-lint.yml -v -q",
|
|
18
|
+
"lint:js": "eslint . --max-warnings 0",
|
|
18
19
|
"test-js": "npm run lint && 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",
|
|
19
20
|
"test-js-file": "npm run lint && tsc && cp -r src/stylesheets lib && cp -r src/images lib && mocha --require lib/testHelper.js",
|
|
20
21
|
"test-js-list": "mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js --reporter ./testReporter.js",
|
|
@@ -154,5 +155,5 @@
|
|
|
154
155
|
"*.{js,jsx,ts,tsx,css,md}": "prettier --write",
|
|
155
156
|
"*.{js,css,md}": "prettier --write"
|
|
156
157
|
},
|
|
157
|
-
"version": "1.41.0-post.
|
|
158
|
+
"version": "1.41.0-post.34"
|
|
158
159
|
}
|
package/testReporter.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const breadcrumbSelector = "ol.breadcrumb";
|
|
2
1
|
let loadingSelector;
|
|
3
2
|
let catalogPage;
|
|
4
3
|
let bookPage;
|
|
@@ -21,68 +20,62 @@ module.exports = {
|
|
|
21
20
|
});
|
|
22
21
|
},
|
|
23
22
|
|
|
24
|
-
"navigate to the first lane and back": function(browser) {
|
|
23
|
+
"navigate to the first lane and back": function (browser) {
|
|
25
24
|
const { laneSelector } = catalogPage.elements;
|
|
26
25
|
const { nthBreadcrumbSelector } = catalogPage;
|
|
27
26
|
|
|
28
|
-
browser
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
let
|
|
32
|
-
this.
|
|
33
|
-
let
|
|
34
|
-
this.getText(laneSelector, function(laneText) {
|
|
35
|
-
let laneTitle = laneText.value;
|
|
27
|
+
browser.goHome().url(function (result) {
|
|
28
|
+
let catalogUrl = result.value;
|
|
29
|
+
this.getAttribute(laneSelector, "href", function (result) {
|
|
30
|
+
let laneUrl = result.value;
|
|
31
|
+
this.getText(laneSelector, function (laneText) {
|
|
32
|
+
let laneTitle = laneText.value;
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
34
|
+
this.click(laneSelector)
|
|
35
|
+
.waitForElementNotPresent(loadingSelector, 5000)
|
|
36
|
+
.verify.noError()
|
|
37
|
+
.verify.urlEquals(laneUrl)
|
|
38
|
+
.verify.titleContains(laneTitle)
|
|
39
|
+
// when a lane selector is clicked, we go into another
|
|
40
|
+
// navigation level
|
|
41
|
+
.verify.elementPresent(nthBreadcrumbSelector(3))
|
|
42
|
+
.back()
|
|
43
|
+
.waitForElementNotPresent(loadingSelector, 5000)
|
|
44
|
+
.verify.urlEquals(catalogUrl)
|
|
45
|
+
.verify.elementNotPresent(nthBreadcrumbSelector(3));
|
|
50
46
|
});
|
|
51
47
|
});
|
|
48
|
+
});
|
|
52
49
|
},
|
|
53
50
|
|
|
54
|
-
"navigate to the first book in the first lane and back": function(browser) {
|
|
55
|
-
const {
|
|
56
|
-
bookSelector,
|
|
57
|
-
bookLinkTitleSelector
|
|
58
|
-
} = catalogPage.elements;
|
|
51
|
+
"navigate to the first book in the first lane and back": function (browser) {
|
|
52
|
+
const { bookSelector, bookLinkTitleSelector } = catalogPage.elements;
|
|
59
53
|
const { bookTitleSelector } = bookPage.elements;
|
|
60
54
|
|
|
61
|
-
browser
|
|
62
|
-
.
|
|
63
|
-
.
|
|
64
|
-
let
|
|
65
|
-
this.
|
|
66
|
-
let
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.waitForElementNotPresent(loadingSelector, 5000)
|
|
78
|
-
.verify.urlEquals(catalogUrl)
|
|
79
|
-
.verify.elementNotPresent(bookTitleSelector);
|
|
80
|
-
});
|
|
55
|
+
browser.goHome().url(function (result) {
|
|
56
|
+
let catalogUrl = result.value;
|
|
57
|
+
this.getAttribute(bookSelector, "href", function (result) {
|
|
58
|
+
let bookUrl = result.value;
|
|
59
|
+
this.getText(bookLinkTitleSelector, function (result) {
|
|
60
|
+
let bookTitle = result.value;
|
|
61
|
+
this.click(bookSelector)
|
|
62
|
+
.waitForElementPresent(bookTitleSelector, 5000)
|
|
63
|
+
.verify.noError()
|
|
64
|
+
.verify.urlEquals(bookUrl)
|
|
65
|
+
.verify.titleContains(bookTitle)
|
|
66
|
+
.verify.containsText(bookTitleSelector, bookTitle)
|
|
67
|
+
.back()
|
|
68
|
+
.waitForElementNotPresent(loadingSelector, 5000)
|
|
69
|
+
.verify.urlEquals(catalogUrl)
|
|
70
|
+
.verify.elementNotPresent(bookTitleSelector);
|
|
81
71
|
});
|
|
82
72
|
});
|
|
73
|
+
});
|
|
83
74
|
},
|
|
84
75
|
|
|
85
|
-
"navigate to the first book, click through tabs, refresh page, go back": function(
|
|
76
|
+
"navigate to the first book, click through tabs, refresh page, go back": function (
|
|
77
|
+
browser
|
|
78
|
+
) {
|
|
86
79
|
const { bookSelector } = catalogPage.elements;
|
|
87
80
|
const {
|
|
88
81
|
bookTitleSelector,
|
|
@@ -95,87 +88,84 @@ module.exports = {
|
|
|
95
88
|
classificationsTabSelector,
|
|
96
89
|
coverTabSelector,
|
|
97
90
|
complaintsTabSelector,
|
|
98
|
-
listsTabSelector
|
|
91
|
+
listsTabSelector,
|
|
99
92
|
} = bookPage.elements;
|
|
100
93
|
|
|
101
|
-
browser
|
|
102
|
-
.
|
|
103
|
-
.getAttribute(bookSelector, "
|
|
104
|
-
let
|
|
105
|
-
this.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.verify.noError()
|
|
111
|
-
.verify.urlEquals(bookUrl)
|
|
112
|
-
.verify.containsText(bookTitleSelector, bookTitle)
|
|
94
|
+
browser.goHome().getAttribute(bookSelector, "href", function (result) {
|
|
95
|
+
let bookUrl = result.value;
|
|
96
|
+
this.getAttribute(bookSelector, "title", function (result) {
|
|
97
|
+
let bookTitle = result.value;
|
|
98
|
+
this.click(bookSelector)
|
|
99
|
+
.waitForElementPresent(bookTitleSelector, 5000)
|
|
100
|
+
.verify.noError()
|
|
101
|
+
.verify.urlEquals(bookUrl)
|
|
102
|
+
.verify.containsText(bookTitleSelector, bookTitle)
|
|
113
103
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
// go to the edit tab
|
|
105
|
+
.click(editTabSelector)
|
|
106
|
+
.waitForElementPresent(titleInputSelector, 5000)
|
|
107
|
+
.verify.urlContains("tab/edit")
|
|
108
|
+
.verify.value(titleInputSelector, bookTitle)
|
|
119
109
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
110
|
+
// go to the classifications tab
|
|
111
|
+
.click(classificationsTabSelector)
|
|
112
|
+
.waitForElementPresent(genreInputSelector, 5000)
|
|
113
|
+
.verify.urlContains("tab/classifications")
|
|
124
114
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
115
|
+
// go to the image cover tab
|
|
116
|
+
.click(coverTabSelector)
|
|
117
|
+
.waitForElementPresent(coverInputSelector, 5000)
|
|
118
|
+
.verify.urlContains("tab/cover")
|
|
129
119
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
// go to the complaints tab
|
|
121
|
+
.click(complaintsTabSelector)
|
|
122
|
+
.waitForElementPresent(complaintInputSelector, 5000)
|
|
123
|
+
.verify.urlContains("tab/complaints")
|
|
124
|
+
.refresh()
|
|
125
|
+
.waitForElementPresent(complaintInputSelector, 5000)
|
|
126
|
+
.verify.urlContains("tab/complaints")
|
|
127
|
+
.verify.titleContains(bookTitle)
|
|
138
128
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
// go to the list tab
|
|
130
|
+
.click(listsTabSelector)
|
|
131
|
+
.waitForElementPresent(listInputSelector, 5000)
|
|
132
|
+
.verify.urlContains("tab/list")
|
|
143
133
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
});
|
|
134
|
+
// go back to the complaints tab
|
|
135
|
+
.back()
|
|
136
|
+
// go back to the cover tab
|
|
137
|
+
.back()
|
|
138
|
+
// go back to the classifications tab
|
|
139
|
+
.back()
|
|
140
|
+
// go back to the edit tab
|
|
141
|
+
.back()
|
|
142
|
+
// go back to the main details tab
|
|
143
|
+
.back()
|
|
144
|
+
.waitForElementPresent(bookTitleSelector, 5000)
|
|
145
|
+
.verify.urlEquals(bookUrl);
|
|
157
146
|
});
|
|
147
|
+
});
|
|
158
148
|
},
|
|
159
149
|
|
|
160
|
-
"navigate to top-level feeds": function(browser) {
|
|
150
|
+
"navigate to top-level feeds": function (browser) {
|
|
161
151
|
const {
|
|
162
152
|
laneSelector,
|
|
163
153
|
complaintsSelector,
|
|
164
|
-
hiddenSelector
|
|
154
|
+
hiddenSelector,
|
|
165
155
|
} = catalogPage.elements;
|
|
166
156
|
const { nthBreadcrumbSelector } = catalogPage;
|
|
167
157
|
|
|
168
158
|
browser
|
|
169
159
|
.goHome()
|
|
170
|
-
.getAttribute(complaintsSelector, "href", function(result) {
|
|
160
|
+
.getAttribute(complaintsSelector, "href", function (result) {
|
|
171
161
|
let complaintsUrl = result.value;
|
|
172
|
-
this.getText(complaintsSelector, function(result) {
|
|
162
|
+
this.getText(complaintsSelector, function (result) {
|
|
173
163
|
let complaintsTitle = result.value;
|
|
174
|
-
this.getAttribute(hiddenSelector, "href", function(result) {
|
|
175
|
-
let hiddenUrl = result.value
|
|
176
|
-
this.getText(hiddenSelector, function(result) {
|
|
164
|
+
this.getAttribute(hiddenSelector, "href", function (result) {
|
|
165
|
+
let hiddenUrl = result.value;
|
|
166
|
+
this.getText(hiddenSelector, function (result) {
|
|
177
167
|
let hiddenTitle = result.value;
|
|
178
|
-
this.getText(laneSelector, function(result) {
|
|
168
|
+
this.getText(laneSelector, function (result) {
|
|
179
169
|
let laneTitle = result.value;
|
|
180
170
|
this
|
|
181
171
|
// go to the first lane
|
|
@@ -192,7 +182,10 @@ module.exports = {
|
|
|
192
182
|
.waitForElementNotPresent(loadingSelector, 5000)
|
|
193
183
|
.assert.noError()
|
|
194
184
|
.assert.containsText(nthBreadcrumbSelector(1), "All Books")
|
|
195
|
-
.assert.containsText(
|
|
185
|
+
.assert.containsText(
|
|
186
|
+
nthBreadcrumbSelector(2),
|
|
187
|
+
complaintsTitle
|
|
188
|
+
)
|
|
196
189
|
.verify.urlEquals(complaintsUrl)
|
|
197
190
|
|
|
198
191
|
// go to the hidden books page
|
|
@@ -209,7 +202,7 @@ module.exports = {
|
|
|
209
202
|
});
|
|
210
203
|
},
|
|
211
204
|
|
|
212
|
-
"navigate to dashboard and back to catalog": function(browser) {
|
|
205
|
+
"navigate to dashboard and back to catalog": function (browser) {
|
|
213
206
|
const {
|
|
214
207
|
catalogSelector,
|
|
215
208
|
dashboardSelector,
|
|
@@ -220,12 +213,11 @@ module.exports = {
|
|
|
220
213
|
|
|
221
214
|
browser
|
|
222
215
|
.goHome()
|
|
223
|
-
.getAttribute(nthBreadcrumbSelector(1), "title", function(result) {
|
|
216
|
+
.getAttribute(nthBreadcrumbSelector(1), "title", function (result) {
|
|
224
217
|
let libraryName = result.value;
|
|
225
|
-
this.getAttribute(catalogSelector, "href", function(result) {
|
|
218
|
+
this.getAttribute(catalogSelector, "href", function (result) {
|
|
226
219
|
let catalogUrl = result.value;
|
|
227
|
-
|
|
228
|
-
let dashboardUrl = result.value
|
|
220
|
+
this.getAttribute(dashboardSelector, "href", function () {
|
|
229
221
|
this
|
|
230
222
|
// go to the dashboard
|
|
231
223
|
.click(dashboardSelector)
|
|
@@ -241,18 +233,16 @@ module.exports = {
|
|
|
241
233
|
.assert.noError()
|
|
242
234
|
.verify.elementPresent(nthBreadcrumbSelector(1))
|
|
243
235
|
.verify.urlEquals(catalogUrl)
|
|
244
|
-
.verify.titleContains(
|
|
236
|
+
.verify.titleContains(
|
|
237
|
+
`Palace Collection Manager - ${libraryName}`
|
|
238
|
+
);
|
|
245
239
|
});
|
|
246
240
|
});
|
|
247
241
|
});
|
|
248
242
|
},
|
|
249
243
|
|
|
250
|
-
"navigate to two different book detail pages": function(browser) {
|
|
251
|
-
const {
|
|
252
|
-
laneSelector,
|
|
253
|
-
firstBookSelector,
|
|
254
|
-
secondBookSelector
|
|
255
|
-
} = catalogPage.elements;
|
|
244
|
+
"navigate to two different book detail pages": function (browser) {
|
|
245
|
+
const { firstBookSelector, secondBookSelector } = catalogPage.elements;
|
|
256
246
|
const { bookTitleSelector } = bookPage.elements;
|
|
257
247
|
const { nthBreadcrumbSelector } = catalogPage;
|
|
258
248
|
|
|
@@ -263,7 +253,7 @@ module.exports = {
|
|
|
263
253
|
.click(firstBookSelector)
|
|
264
254
|
.waitForElementNotPresent(loadingSelector, 5000)
|
|
265
255
|
.waitForElementPresent(bookTitleSelector, 5000)
|
|
266
|
-
.getText(bookTitleSelector, function(result) {
|
|
256
|
+
.getText(bookTitleSelector, function (result) {
|
|
267
257
|
let firstTitle = result.value;
|
|
268
258
|
|
|
269
259
|
this
|
|
@@ -278,7 +268,7 @@ module.exports = {
|
|
|
278
268
|
.waitForElementPresent(bookTitleSelector, 50000)
|
|
279
269
|
|
|
280
270
|
// making sure that we are on a new book
|
|
281
|
-
.getText(bookTitleSelector, function(result) {
|
|
271
|
+
.getText(bookTitleSelector, function (result) {
|
|
282
272
|
let secondTitle = result.value;
|
|
283
273
|
this.assert.notEqual(firstTitle, secondTitle);
|
|
284
274
|
});
|
|
@@ -290,5 +280,5 @@ module.exports = {
|
|
|
290
280
|
*/
|
|
291
281
|
after: (browser) => {
|
|
292
282
|
browser.end();
|
|
293
|
-
}
|
|
283
|
+
},
|
|
294
284
|
};
|
|
@@ -1,44 +1,30 @@
|
|
|
1
|
-
const http = require(
|
|
1
|
+
const http = require("follow-redirects").http;
|
|
2
2
|
|
|
3
|
-
const fetchGroupPage = (
|
|
3
|
+
const fetchGroupPage = () => {
|
|
4
4
|
return new Promise((resolve, reject) => {
|
|
5
|
-
http.get(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
http.get(
|
|
6
|
+
{
|
|
7
|
+
host: "localhost",
|
|
8
|
+
port: 6500,
|
|
9
|
+
path: "/groups/",
|
|
10
|
+
},
|
|
11
|
+
(response) => {
|
|
12
|
+
let body = "";
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
response.on("data", (chunk) => {
|
|
15
|
+
body += chunk;
|
|
16
|
+
});
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
response.on("error", (err) => {
|
|
19
|
+
reject(err);
|
|
20
|
+
});
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const getAdminBookUrlAndTitle = (body, browser) => {
|
|
27
|
-
const bookTitle = body.match(/<entry [\s\S]+?<title>([^<]+)<\/title>/i)[1];
|
|
28
|
-
const link = body.match(/<link [^>]*rel="alternate[^>]+\/>/i)[0];
|
|
29
|
-
const id = body.match(/<id>[\s\S]+?<\/id>/i)[0];
|
|
30
|
-
const lib = id.match(/\/[\w]+/i)[0]; // includes forward slash
|
|
31
|
-
const bookUrl = link.match(/href="([^"]+)"/)[1];
|
|
32
|
-
const entryBaseUrl = browser.globals.homeUrl.replace("/admin/web/", lib + "/works");
|
|
33
|
-
|
|
34
|
-
// transform the book url into an admin book url
|
|
35
|
-
const adminBookUrl =
|
|
36
|
-
browser.globals.homeUrl + "collection" + lib + "/book" + lib +
|
|
37
|
-
encodeURIComponent(
|
|
38
|
-
bookUrl.replace(entryBaseUrl, "")
|
|
22
|
+
response.on("end", () => {
|
|
23
|
+
resolve(body);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
39
26
|
);
|
|
40
|
-
|
|
41
|
-
return { adminBookUrl, bookTitle };
|
|
27
|
+
});
|
|
42
28
|
};
|
|
43
29
|
const getAdminListUrl = (body, browser) => {
|
|
44
30
|
const listBaseUrl = `${browser.globals.homeUrl}lists`;
|
|
@@ -56,11 +42,10 @@ module.exports = {
|
|
|
56
42
|
loginPage = browser.page.login();
|
|
57
43
|
loadingSelector = browser.page.catalog().elements.loadingSelector;
|
|
58
44
|
|
|
59
|
-
fetchGroupPage(browser)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
45
|
+
fetchGroupPage(browser).then((data) => {
|
|
46
|
+
body = data;
|
|
47
|
+
done();
|
|
48
|
+
});
|
|
64
49
|
},
|
|
65
50
|
|
|
66
51
|
"attempt to view the admin list page before signing in": (browser) => {
|
|
@@ -100,5 +85,5 @@ module.exports = {
|
|
|
100
85
|
|
|
101
86
|
afterEach: (browser) => {
|
|
102
87
|
browser.end();
|
|
103
|
-
}
|
|
88
|
+
},
|
|
104
89
|
};
|
|
@@ -5,7 +5,7 @@ import AdvancedSearchBuilder from "../../../src/components/AdvancedSearchBuilder
|
|
|
5
5
|
|
|
6
6
|
describe("AdvancedSearchBuilder", () => {
|
|
7
7
|
it("renders a placeholder and help text when the publication date filter is selected", async () => {
|
|
8
|
-
|
|
8
|
+
userEvent.setup();
|
|
9
9
|
|
|
10
10
|
const query = {
|
|
11
11
|
id: "0",
|
|
@@ -11,7 +11,6 @@ import { ConfigurationSettings } from "../../../src/interfaces";
|
|
|
11
11
|
describe("CustomLists", () => {
|
|
12
12
|
// Stub scrollTo, since a component in the render tree will try to call it, and it is not
|
|
13
13
|
// provided by JSDOM.
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
15
14
|
Element.prototype.scrollTo = () => {};
|
|
16
15
|
|
|
17
16
|
const server = setupServer(
|
|
@@ -56,7 +56,6 @@ const MOCK_DEBUG_RESULTS: PatronDebugResponse = {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
describe("DebugAuthentication", () => {
|
|
59
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
60
59
|
const queryClient = new QueryClient({
|
|
61
60
|
defaultOptions: {
|
|
62
61
|
queries: {
|
|
@@ -69,7 +68,6 @@ describe("DebugAuthentication", () => {
|
|
|
69
68
|
error: process.env.NODE_ENV === "test" ? () => {} : console.error,
|
|
70
69
|
},
|
|
71
70
|
});
|
|
72
|
-
/* eslint-enable @typescript-eslint/no-empty-function */
|
|
73
71
|
|
|
74
72
|
const server = setupServer(
|
|
75
73
|
http.get(AUTH_METHODS_PATH, () =>
|
|
@@ -55,7 +55,6 @@ const setupMockServer = () => {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
describe("InventoryReportRequestModal", () => {
|
|
58
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
59
58
|
const queryClient = new QueryClient({
|
|
60
59
|
defaultOptions: {
|
|
61
60
|
queries: {
|
|
@@ -68,7 +67,6 @@ describe("InventoryReportRequestModal", () => {
|
|
|
68
67
|
error: process.env.NODE_ENV === "test" ? () => {} : console.error,
|
|
69
68
|
},
|
|
70
69
|
});
|
|
71
|
-
/* eslint-enable @typescript-eslint/no-empty-function */
|
|
72
70
|
|
|
73
71
|
describe("query hooks call correct api methods", () => {
|
|
74
72
|
const wrapper = componentWithProviders({ queryClient });
|
|
@@ -12,7 +12,7 @@ import LaneEditor from "../../../src/components/LaneEditor";
|
|
|
12
12
|
|
|
13
13
|
jest.mock("../../../src/components/LaneCustomListsEditor", () => ({
|
|
14
14
|
__esModule: true,
|
|
15
|
-
default: (
|
|
15
|
+
default: () => <div data-testid="LaneCustomListsEditor" />,
|
|
16
16
|
}));
|
|
17
17
|
|
|
18
18
|
const customListsData = [
|
|
@@ -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
|
|