@thepalaceproject/circulation-admin 1.41.0-post.8 → 1.42.0-post.6
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.css +1 -1
- package/dist/circulation-admin.js +1 -1
- package/dist/circulation-admin.js.LICENSE.txt +1 -9
- package/eslint.config.mjs +90 -0
- package/jest.polyfills.js +0 -1
- package/package.json +33 -34
- 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/CollectionReapButton.test.tsx +240 -0
- package/tests/jest/components/Collections.test.tsx +1 -0
- 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/.eslintrc +0 -67
- package/tslint.json +0 -56
|
@@ -10,14 +10,6 @@ object-assign
|
|
|
10
10
|
http://jedwatson.github.io/classnames
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
/*!
|
|
14
|
-
* JavaScript Cookie v2.2.1
|
|
15
|
-
* https://github.com/js-cookie/js-cookie
|
|
16
|
-
*
|
|
17
|
-
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
18
|
-
* Released under the MIT license
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
13
|
/*!
|
|
22
14
|
* Programatically add the following
|
|
23
15
|
*/
|
|
@@ -29,7 +21,7 @@ object-assign
|
|
|
29
21
|
* @license MIT
|
|
30
22
|
*/
|
|
31
23
|
|
|
32
|
-
/*! @license DOMPurify 3.
|
|
24
|
+
/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
|
|
33
25
|
|
|
34
26
|
/*! @preserve
|
|
35
27
|
* numeral.js
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
import react from "eslint-plugin-react";
|
|
4
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
5
|
+
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
6
|
+
import prettier from "eslint-config-prettier";
|
|
7
|
+
import globals from "globals";
|
|
8
|
+
|
|
9
|
+
export default tseslint.config(
|
|
10
|
+
{
|
|
11
|
+
ignores: ["dist/", "lib/", "docs/", "typings/", "node_modules/"],
|
|
12
|
+
},
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
...tseslint.configs.recommended,
|
|
15
|
+
react.configs.flat.recommended,
|
|
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
|
+
},
|
|
26
|
+
{
|
|
27
|
+
files: ["**/*.{js,jsx,ts,tsx}"],
|
|
28
|
+
plugins: {
|
|
29
|
+
"react-hooks": reactHooks,
|
|
30
|
+
},
|
|
31
|
+
languageOptions: {
|
|
32
|
+
// JSX is enabled by react.configs.flat.recommended and sourceType
|
|
33
|
+
// defaults to "module" in flat config, so neither needs to be set here.
|
|
34
|
+
globals: {
|
|
35
|
+
...globals.browser,
|
|
36
|
+
...globals.node,
|
|
37
|
+
...globals.jest,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
// Enable the two classic react-hooks rules explicitly rather than
|
|
42
|
+
// spreading `reactHooks.configs.recommended.rules`. eslint-plugin-react-hooks
|
|
43
|
+
// v7's recommended preset also turns on newer React Compiler rules
|
|
44
|
+
// (set-state-in-effect, refs, etc.).
|
|
45
|
+
// TODO: Adopt these new rules.
|
|
46
|
+
"react-hooks/rules-of-hooks": "error",
|
|
47
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
48
|
+
"react/jsx-filename-extension": [
|
|
49
|
+
1,
|
|
50
|
+
{ extensions: [".js", ".jsx", ".ts", ".tsx"] },
|
|
51
|
+
],
|
|
52
|
+
"react/jsx-props-no-spreading": 0,
|
|
53
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
54
|
+
"no-useless-escape": 0,
|
|
55
|
+
"@typescript-eslint/explicit-function-return-type": 0,
|
|
56
|
+
"react/prop-types": 0,
|
|
57
|
+
"react/no-string-refs": 0,
|
|
58
|
+
"jsx-a11y/label-has-associated-control": 0,
|
|
59
|
+
"react/no-find-dom-node": 0,
|
|
60
|
+
"react/no-unescaped-entities": 0,
|
|
61
|
+
"@typescript-eslint/no-inferrable-types": 0,
|
|
62
|
+
// These rules conflict with idioms throughout this codebase, so we
|
|
63
|
+
// keep them off to preserve prior linting behavior:
|
|
64
|
+
// - short-circuit side effects, e.g. `cond && doThing()`, and chai
|
|
65
|
+
// assertions like `expect(x).to.be.true` (no-unused-expressions)
|
|
66
|
+
// - empty props/state types, e.g. `React.Component<{}, {}>`
|
|
67
|
+
// (no-empty-object-type)
|
|
68
|
+
// - `import x = require("x")` and CommonJS webpack configs
|
|
69
|
+
// (no-require-imports)
|
|
70
|
+
// TODO: Evaluate these rules to see if we want to apply them.
|
|
71
|
+
"@typescript-eslint/no-unused-expressions": 0,
|
|
72
|
+
"@typescript-eslint/no-empty-object-type": 0,
|
|
73
|
+
"@typescript-eslint/no-require-imports": 0,
|
|
74
|
+
"@typescript-eslint/no-unused-vars": [
|
|
75
|
+
"warn",
|
|
76
|
+
{
|
|
77
|
+
argsIgnorePattern: "^_",
|
|
78
|
+
varsIgnorePattern: "^_",
|
|
79
|
+
ignoreRestSiblings: true,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
"no-var": "error",
|
|
83
|
+
"no-eval": "error",
|
|
84
|
+
eqeqeq: ["error", "smart"],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
// Disable ESLint formatting rules that conflict with Prettier.
|
|
88
|
+
// This should be the last option so it overrides previous rules.
|
|
89
|
+
prettier
|
|
90
|
+
);
|
package/jest.polyfills.js
CHANGED
package/package.json
CHANGED
|
@@ -10,17 +10,18 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=20.0.0",
|
|
13
|
-
"npm": ">=10.0.0"
|
|
13
|
+
"npm": ">=10.0.0 <11.0.0"
|
|
14
14
|
},
|
|
15
|
+
"packageManager": "npm@10.8.2",
|
|
15
16
|
"scripts": {
|
|
16
17
|
"prepublish": "npm run prod",
|
|
17
|
-
"lint": "
|
|
18
|
-
"
|
|
19
|
-
"test-js
|
|
18
|
+
"lint": "npm run lint:js && sass-lint -c .sass-lint.yml -v -q",
|
|
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",
|
|
20
22
|
"test-js-list": "mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js --reporter ./testReporter.js",
|
|
21
|
-
"test-ts": "
|
|
22
|
-
"test-file-ts": "
|
|
23
|
-
"test-file-ts-nolint": "mocha -r ts-node/register --require src/testHelper.ts",
|
|
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",
|
|
24
25
|
"test": "npm run test-ts && npm run test-jest",
|
|
25
26
|
"test-file": "npm run test-file-ts",
|
|
26
27
|
"test-browser": "npm run test-chrome && npm run test-firefox",
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"sync-patron-blocking-docs": "node scripts/syncPatronBlockingDocs.js"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@nypl/dgx-svg-icons": "0.3.
|
|
40
|
+
"@nypl/dgx-svg-icons": "0.3.14",
|
|
40
41
|
"@reduxjs/toolkit": "^2.2.5",
|
|
41
42
|
"@tanstack/react-query": "^4.36.1",
|
|
42
|
-
"@thepalaceproject/web-opds-client": "^1.
|
|
43
|
+
"@thepalaceproject/web-opds-client": "^1.2.0",
|
|
43
44
|
"bootstrap": "^3.3.6",
|
|
44
45
|
"classnames": "^2.3.1",
|
|
45
46
|
"draft-convert": "^2.1.5",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"isomorphic-fetch": "^3.0.0",
|
|
50
51
|
"library-simplified-reusable-components": "1.3.18",
|
|
51
52
|
"numeral": "^2.0.6",
|
|
52
|
-
"opds-feed-parser": "0.0
|
|
53
|
+
"opds-feed-parser": "0.1.0",
|
|
53
54
|
"prop-types": "^15.7.2",
|
|
54
55
|
"qs": "^6.15.2",
|
|
55
56
|
"react": "^16.8.6",
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
"@testing-library/user-event": "^14.4.3",
|
|
78
79
|
"@types/jest": "^29.2.6",
|
|
79
80
|
"@types/mocha": "^10.0.1",
|
|
80
|
-
"@types/node": "^
|
|
81
|
+
"@types/node": "^25.9.3",
|
|
81
82
|
"@types/numeral": "^2.0.5",
|
|
82
83
|
"@types/prop-types": "^15.7.3",
|
|
83
84
|
"@types/react": "^16.14.6",
|
|
@@ -86,8 +87,7 @@
|
|
|
86
87
|
"@types/react-router": "^3.0.28",
|
|
87
88
|
"@types/recharts": "^1.8.28",
|
|
88
89
|
"@types/redux-mock-store": "^1.0.3",
|
|
89
|
-
"@
|
|
90
|
-
"@typescript-eslint/parser": "^5.46.0",
|
|
90
|
+
"@eslint/js": "^9.39.4",
|
|
91
91
|
"chai": "4.2.0",
|
|
92
92
|
"clean-webpack-plugin": "^2.0.1",
|
|
93
93
|
"colors-cli": "^1.0.27",
|
|
@@ -96,53 +96,52 @@
|
|
|
96
96
|
"dotenv-cli": "^11.0.0",
|
|
97
97
|
"enzyme": "^3.11.0",
|
|
98
98
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
99
|
-
"eslint": "^
|
|
100
|
-
"eslint-config-prettier": "^
|
|
101
|
-
"eslint-plugin-jsx-a11y": "^6.2
|
|
102
|
-
"eslint-plugin-
|
|
103
|
-
"eslint-plugin-react": "^7.
|
|
104
|
-
"eslint-plugin-react-hooks": "^4.0.0",
|
|
99
|
+
"eslint": "^9.39.4",
|
|
100
|
+
"eslint-config-prettier": "^10.1.8",
|
|
101
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
102
|
+
"eslint-plugin-react": "^7.37.5",
|
|
103
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
105
104
|
"fetch-mock": "^10.0.7",
|
|
106
105
|
"fetch-mock-jest": "^1.5.1",
|
|
107
106
|
"fetch-ponyfill": "^7.1.0",
|
|
108
107
|
"file-loader": "^6.2.0",
|
|
109
108
|
"follow-redirects": "^1.16.0",
|
|
110
|
-
"
|
|
109
|
+
"globals": "^16.5.0",
|
|
110
|
+
"husky": "^9.1.7",
|
|
111
111
|
"jest": "^29.3.1",
|
|
112
|
-
"jest-environment-jsdom": "^
|
|
113
|
-
"jest-fixed-jsdom": "^0.0.
|
|
114
|
-
"jsdom": "^
|
|
112
|
+
"jest-environment-jsdom": "^30.4.1",
|
|
113
|
+
"jest-fixed-jsdom": "^0.0.11",
|
|
114
|
+
"jsdom": "^29.1.1",
|
|
115
115
|
"json-loader": "^0.5.4",
|
|
116
|
-
"lint-staged": "^
|
|
117
|
-
"marked": "^
|
|
116
|
+
"lint-staged": "^17.0.7",
|
|
117
|
+
"marked": "^18.0.5",
|
|
118
118
|
"mini-css-extract-plugin": "1.6.0",
|
|
119
|
-
"mocha": "^
|
|
119
|
+
"mocha": "^11.7.6",
|
|
120
120
|
"msw": "^2.7.3",
|
|
121
121
|
"nightwatch": "^3.14.0",
|
|
122
|
-
"prettier": "
|
|
122
|
+
"prettier": "3.8.4",
|
|
123
123
|
"react-axe": "^3.3.0",
|
|
124
124
|
"react-test-renderer": "^16.14.0",
|
|
125
125
|
"redux-mock-store": "^1.5.4",
|
|
126
126
|
"resize-observer-polyfill": "^1.5.1",
|
|
127
127
|
"sass": "^1.64.2",
|
|
128
128
|
"sass-lint": "^1.13.1",
|
|
129
|
-
"sass-loader": "^
|
|
129
|
+
"sass-loader": "^17.0.0",
|
|
130
130
|
"selenium-standalone": "^10.0.2",
|
|
131
131
|
"sinon": "7.5.0",
|
|
132
|
-
"style-loader": "^0.
|
|
132
|
+
"style-loader": "^4.0.0",
|
|
133
133
|
"terser-webpack-plugin": "^5.3.6",
|
|
134
134
|
"ts-jest": "^29.2.6",
|
|
135
135
|
"ts-loader": "^9.5.2",
|
|
136
136
|
"ts-node": "^10.9.2",
|
|
137
|
-
"
|
|
138
|
-
"tslint-react-a11y": "^1.1.0",
|
|
139
|
-
"typedoc": "^0.27.9",
|
|
137
|
+
"typedoc": "^0.28.19",
|
|
140
138
|
"typescript": "^5.7.3",
|
|
139
|
+
"typescript-eslint": "^8.60.1",
|
|
141
140
|
"url-loader": "^4.1.1",
|
|
142
141
|
"webpack": "^5.105.2",
|
|
143
142
|
"webpack-cli": "^5.0.1",
|
|
144
143
|
"webpack-dev-server": "^5.2.4",
|
|
145
|
-
"webpack-merge": "^
|
|
144
|
+
"webpack-merge": "^6.0.1"
|
|
146
145
|
},
|
|
147
146
|
"husky": {
|
|
148
147
|
"hooks": {
|
|
@@ -154,5 +153,5 @@
|
|
|
154
153
|
"*.{js,jsx,ts,tsx,css,md}": "prettier --write",
|
|
155
154
|
"*.{js,css,md}": "prettier --write"
|
|
156
155
|
},
|
|
157
|
-
"version": "1.
|
|
156
|
+
"version": "1.42.0-post.6"
|
|
158
157
|
}
|
package/testReporter.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
const bookSelector = ".lane-books li:first-child a";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @method goHome
|
|
5
5
|
* @api command
|
|
6
6
|
* @description This custom command navigates the user to the home page.
|
|
7
7
|
*/
|
|
8
|
-
exports.command = function() {
|
|
9
|
-
return this
|
|
10
|
-
.url(this.globals.homeUrl)
|
|
8
|
+
exports.command = function () {
|
|
9
|
+
return this.url(this.globals.homeUrl)
|
|
11
10
|
.waitForElementVisible(bookSelector, 5000)
|
|
12
11
|
.verify.noError();
|
|
13
12
|
};
|
|
@@ -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
|
};
|