@truedat/se 4.44.3 → 4.45.0
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/package.json +22 -18
- package/src/components/__tests__/Search.spec.js +5 -3
- package/src/components/__tests__/SearchPagination.spec.js +13 -28
- package/src/components/__tests__/SearchResults.spec.js +4 -4
- package/src/components/__tests__/__snapshots__/Search.spec.js.snap +162 -6
- package/src/components/__tests__/__snapshots__/SearchPagination.spec.js.snap +112 -34
- package/src/components/__tests__/__snapshots__/SearchResults.spec.js.snap +24 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/se",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.45.0",
|
|
4
4
|
"description": "Truedat Web Search Engine",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -16,25 +16,26 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"clean": "rimraf yarn-error.log",
|
|
18
18
|
"debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
19
|
-
"test": "jest --coverage",
|
|
20
|
-
"test:watch": "jest --watch",
|
|
19
|
+
"test": "TZ=UTC jest --coverage",
|
|
20
|
+
"test:watch": "TZ=UTC jest --watch",
|
|
21
21
|
"eslint": "eslint src/**",
|
|
22
22
|
"eslint:fix": "eslint --fix src/**"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/cli": "^7.
|
|
26
|
-
"@babel/core": "^7.
|
|
27
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
28
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
25
|
+
"@babel/cli": "^7.17.10",
|
|
26
|
+
"@babel/core": "^7.18.0",
|
|
27
|
+
"@babel/plugin-proposal-class-properties": "^7.17.12",
|
|
28
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.18.0",
|
|
29
|
+
"@babel/plugin-proposal-optional-chaining": "^7.17.12",
|
|
29
30
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
30
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
31
|
-
"@babel/preset-env": "^7.
|
|
32
|
-
"@babel/preset-react": "^7.
|
|
33
|
-
"@testing-library/jest-dom": "^5.
|
|
31
|
+
"@babel/plugin-transform-modules-commonjs": "^7.18.0",
|
|
32
|
+
"@babel/preset-env": "^7.18.0",
|
|
33
|
+
"@babel/preset-react": "^7.17.12",
|
|
34
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
34
35
|
"@testing-library/react": "^12.0.0",
|
|
35
36
|
"@testing-library/user-event": "^13.2.1",
|
|
36
|
-
"@truedat/test": "4.
|
|
37
|
-
"babel-jest": "^
|
|
37
|
+
"@truedat/test": "4.45.0",
|
|
38
|
+
"babel-jest": "^28.1.0",
|
|
38
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
39
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
40
41
|
"babel-plugin-react-intl": "^5.1.18",
|
|
@@ -43,7 +44,8 @@
|
|
|
43
44
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
44
45
|
"enzyme-to-json": "^3.6.2",
|
|
45
46
|
"identity-obj-proxy": "^3.0.0",
|
|
46
|
-
"jest": "^
|
|
47
|
+
"jest": "^28.1.0",
|
|
48
|
+
"jest-environment-jsdom": "^28.1.0",
|
|
47
49
|
"react": "^16.14.0",
|
|
48
50
|
"react-dom": "^16.14.0",
|
|
49
51
|
"redux-saga-test-plan": "^4.0.4",
|
|
@@ -51,6 +53,8 @@
|
|
|
51
53
|
"semantic-ui-react": "^2.0.3"
|
|
52
54
|
},
|
|
53
55
|
"jest": {
|
|
56
|
+
"maxWorkers": "50%",
|
|
57
|
+
"testTimeout": 10000,
|
|
54
58
|
"moduleDirectories": [
|
|
55
59
|
"<rootDir>/src",
|
|
56
60
|
"../../node_modules"
|
|
@@ -83,11 +87,11 @@
|
|
|
83
87
|
]
|
|
84
88
|
},
|
|
85
89
|
"dependencies": {
|
|
86
|
-
"@truedat/core": "4.
|
|
90
|
+
"@truedat/core": "4.45.0",
|
|
87
91
|
"path-to-regexp": "^1.7.0",
|
|
88
|
-
"prop-types": "^15.
|
|
92
|
+
"prop-types": "^15.8.1",
|
|
89
93
|
"react-intl": "^5.20.10",
|
|
90
|
-
"react-moment": "^
|
|
94
|
+
"react-moment": "^1.1.2",
|
|
91
95
|
"react-redux": "^7.2.4",
|
|
92
96
|
"react-router-dom": "^5.2.0",
|
|
93
97
|
"redux": "^4.1.1",
|
|
@@ -100,5 +104,5 @@
|
|
|
100
104
|
"react-dom": ">= 16.8.6 < 17",
|
|
101
105
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
102
106
|
},
|
|
103
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "b8a49c6bae0bbde203dfb4763a5657fc398e3b7a"
|
|
104
108
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
3
|
import { Search } from "../Search";
|
|
4
4
|
|
|
5
|
+
const state = { searchQuery: { page: 1, size: 10 }, searchCount: 51 };
|
|
6
|
+
|
|
5
7
|
describe("<Search />", () => {
|
|
6
8
|
it("it matches the last snapshot", () => {
|
|
7
|
-
const
|
|
8
|
-
expect(
|
|
9
|
+
const { container } = render(<Search />, { state });
|
|
10
|
+
expect(container).toMatchSnapshot();
|
|
9
11
|
});
|
|
10
12
|
});
|
|
@@ -1,39 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import SearchPagination from "../SearchPagination";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const totalPages = 5;
|
|
7
|
-
const selectSearchPage = jest.fn();
|
|
8
|
-
const activePage = 1;
|
|
5
|
+
const state = { searchQuery: { page: 1, size: 10 }, searchCount: 51 };
|
|
9
6
|
|
|
7
|
+
describe("<SearchPagination />", () => {
|
|
10
8
|
it("it matches the last snapshot", () => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
selectSearchPage,
|
|
14
|
-
activePage
|
|
15
|
-
};
|
|
16
|
-
const wrapper = shallowWithIntl(<SearchPagination {...props} />);
|
|
17
|
-
expect(wrapper).toMatchSnapshot();
|
|
9
|
+
const { container } = render(<SearchPagination />, { state });
|
|
10
|
+
expect(container).toMatchSnapshot();
|
|
18
11
|
});
|
|
19
12
|
|
|
20
13
|
it("it renders Pagination when totalPages not 0", () => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
selectSearchPage,
|
|
24
|
-
activePage
|
|
25
|
-
};
|
|
26
|
-
const wrapper = shallowWithIntl(<SearchPagination {...props} />);
|
|
27
|
-
expect(wrapper.find("Pagination").length).toBe(1);
|
|
14
|
+
const { container } = render(<SearchPagination />, { state });
|
|
15
|
+
expect(container).not.toBeEmptyDOMElement();
|
|
28
16
|
});
|
|
29
17
|
|
|
30
|
-
it("it renders
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
const wrapper = shallowWithIntl(<SearchPagination {...props} />);
|
|
37
|
-
expect(wrapper.getElement()).toBeNull();
|
|
18
|
+
it("it renders nothing when total is 0", () => {
|
|
19
|
+
const { container } = render(<SearchPagination />, {
|
|
20
|
+
state: { ...state, searchCount: 0 },
|
|
21
|
+
});
|
|
22
|
+
expect(container).toBeEmptyDOMElement();
|
|
38
23
|
});
|
|
39
24
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
3
|
import { SearchResults } from "../SearchResults";
|
|
4
4
|
|
|
5
5
|
describe("<SearchResults />", () => {
|
|
@@ -13,9 +13,9 @@ describe("<SearchResults />", () => {
|
|
|
13
13
|
history,
|
|
14
14
|
loading,
|
|
15
15
|
results,
|
|
16
|
-
searchCount
|
|
16
|
+
searchCount,
|
|
17
17
|
};
|
|
18
|
-
const
|
|
19
|
-
expect(
|
|
18
|
+
const { container } = render(<SearchResults {...props} />);
|
|
19
|
+
expect(container).toMatchSnapshot();
|
|
20
20
|
});
|
|
21
21
|
});
|
|
@@ -1,10 +1,166 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<Search /> it matches the last snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui segment"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="ui icon input custom"
|
|
10
|
+
>
|
|
11
|
+
<input
|
|
12
|
+
placeholder="Search"
|
|
13
|
+
type="text"
|
|
14
|
+
value=""
|
|
15
|
+
/>
|
|
16
|
+
<i
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
class="search link icon"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
class="ui pointing secondary tabular menu"
|
|
23
|
+
>
|
|
24
|
+
<a
|
|
25
|
+
class="item"
|
|
26
|
+
href="/search/results"
|
|
27
|
+
>
|
|
28
|
+
All
|
|
29
|
+
</a>
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
class="ui icon message"
|
|
33
|
+
>
|
|
34
|
+
<i
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
class="search icon"
|
|
37
|
+
/>
|
|
38
|
+
<div
|
|
39
|
+
class="content"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
class="header"
|
|
43
|
+
>
|
|
44
|
+
No results found
|
|
45
|
+
</div>
|
|
46
|
+
<a
|
|
47
|
+
class="link pointer"
|
|
48
|
+
href="/search"
|
|
49
|
+
>
|
|
50
|
+
Try another search
|
|
51
|
+
</a>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div
|
|
55
|
+
aria-label="Pagination Navigation"
|
|
56
|
+
class="ui pagination menu"
|
|
57
|
+
role="navigation"
|
|
58
|
+
>
|
|
59
|
+
<a
|
|
60
|
+
aria-current="false"
|
|
61
|
+
aria-disabled="false"
|
|
62
|
+
aria-label="First item"
|
|
63
|
+
class="item"
|
|
64
|
+
tabindex="0"
|
|
65
|
+
type="firstItem"
|
|
66
|
+
value="1"
|
|
67
|
+
>
|
|
68
|
+
«
|
|
69
|
+
</a>
|
|
70
|
+
<a
|
|
71
|
+
aria-current="false"
|
|
72
|
+
aria-disabled="false"
|
|
73
|
+
aria-label="Previous item"
|
|
74
|
+
class="item"
|
|
75
|
+
tabindex="0"
|
|
76
|
+
type="prevItem"
|
|
77
|
+
value="1"
|
|
78
|
+
>
|
|
79
|
+
⟨
|
|
80
|
+
</a>
|
|
81
|
+
<a
|
|
82
|
+
aria-current="true"
|
|
83
|
+
aria-disabled="false"
|
|
84
|
+
class="active item"
|
|
85
|
+
tabindex="0"
|
|
86
|
+
type="pageItem"
|
|
87
|
+
value="1"
|
|
88
|
+
>
|
|
89
|
+
1
|
|
90
|
+
</a>
|
|
91
|
+
<a
|
|
92
|
+
aria-current="false"
|
|
93
|
+
aria-disabled="false"
|
|
94
|
+
class="item"
|
|
95
|
+
tabindex="0"
|
|
96
|
+
type="pageItem"
|
|
97
|
+
value="2"
|
|
98
|
+
>
|
|
99
|
+
2
|
|
100
|
+
</a>
|
|
101
|
+
<a
|
|
102
|
+
aria-current="false"
|
|
103
|
+
aria-disabled="false"
|
|
104
|
+
class="item"
|
|
105
|
+
tabindex="0"
|
|
106
|
+
type="pageItem"
|
|
107
|
+
value="3"
|
|
108
|
+
>
|
|
109
|
+
3
|
|
110
|
+
</a>
|
|
111
|
+
<a
|
|
112
|
+
aria-current="false"
|
|
113
|
+
aria-disabled="false"
|
|
114
|
+
class="item"
|
|
115
|
+
tabindex="0"
|
|
116
|
+
type="pageItem"
|
|
117
|
+
value="4"
|
|
118
|
+
>
|
|
119
|
+
4
|
|
120
|
+
</a>
|
|
121
|
+
<a
|
|
122
|
+
aria-current="false"
|
|
123
|
+
aria-disabled="false"
|
|
124
|
+
class="item"
|
|
125
|
+
tabindex="0"
|
|
126
|
+
type="pageItem"
|
|
127
|
+
value="5"
|
|
128
|
+
>
|
|
129
|
+
5
|
|
130
|
+
</a>
|
|
131
|
+
<a
|
|
132
|
+
aria-current="false"
|
|
133
|
+
aria-disabled="false"
|
|
134
|
+
class="item"
|
|
135
|
+
tabindex="0"
|
|
136
|
+
type="pageItem"
|
|
137
|
+
value="6"
|
|
138
|
+
>
|
|
139
|
+
6
|
|
140
|
+
</a>
|
|
141
|
+
<a
|
|
142
|
+
aria-current="false"
|
|
143
|
+
aria-disabled="false"
|
|
144
|
+
aria-label="Next item"
|
|
145
|
+
class="item"
|
|
146
|
+
tabindex="0"
|
|
147
|
+
type="nextItem"
|
|
148
|
+
value="2"
|
|
149
|
+
>
|
|
150
|
+
⟩
|
|
151
|
+
</a>
|
|
152
|
+
<a
|
|
153
|
+
aria-current="false"
|
|
154
|
+
aria-disabled="false"
|
|
155
|
+
aria-label="Last item"
|
|
156
|
+
class="item"
|
|
157
|
+
tabindex="0"
|
|
158
|
+
type="lastItem"
|
|
159
|
+
value="6"
|
|
160
|
+
>
|
|
161
|
+
»
|
|
162
|
+
</a>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
10
166
|
`;
|
|
@@ -1,38 +1,116 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<SearchPagination /> it matches the last snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
aria-label="Pagination Navigation"
|
|
7
|
+
class="ui pagination menu"
|
|
8
|
+
role="navigation"
|
|
9
|
+
>
|
|
10
|
+
<a
|
|
11
|
+
aria-current="false"
|
|
12
|
+
aria-disabled="false"
|
|
13
|
+
aria-label="First item"
|
|
14
|
+
class="item"
|
|
15
|
+
tabindex="0"
|
|
16
|
+
type="firstItem"
|
|
17
|
+
value="1"
|
|
18
|
+
>
|
|
19
|
+
«
|
|
20
|
+
</a>
|
|
21
|
+
<a
|
|
22
|
+
aria-current="false"
|
|
23
|
+
aria-disabled="false"
|
|
24
|
+
aria-label="Previous item"
|
|
25
|
+
class="item"
|
|
26
|
+
tabindex="0"
|
|
27
|
+
type="prevItem"
|
|
28
|
+
value="1"
|
|
29
|
+
>
|
|
30
|
+
⟨
|
|
31
|
+
</a>
|
|
32
|
+
<a
|
|
33
|
+
aria-current="true"
|
|
34
|
+
aria-disabled="false"
|
|
35
|
+
class="active item"
|
|
36
|
+
tabindex="0"
|
|
37
|
+
type="pageItem"
|
|
38
|
+
value="1"
|
|
39
|
+
>
|
|
40
|
+
1
|
|
41
|
+
</a>
|
|
42
|
+
<a
|
|
43
|
+
aria-current="false"
|
|
44
|
+
aria-disabled="false"
|
|
45
|
+
class="item"
|
|
46
|
+
tabindex="0"
|
|
47
|
+
type="pageItem"
|
|
48
|
+
value="2"
|
|
49
|
+
>
|
|
50
|
+
2
|
|
51
|
+
</a>
|
|
52
|
+
<a
|
|
53
|
+
aria-current="false"
|
|
54
|
+
aria-disabled="false"
|
|
55
|
+
class="item"
|
|
56
|
+
tabindex="0"
|
|
57
|
+
type="pageItem"
|
|
58
|
+
value="3"
|
|
59
|
+
>
|
|
60
|
+
3
|
|
61
|
+
</a>
|
|
62
|
+
<a
|
|
63
|
+
aria-current="false"
|
|
64
|
+
aria-disabled="false"
|
|
65
|
+
class="item"
|
|
66
|
+
tabindex="0"
|
|
67
|
+
type="pageItem"
|
|
68
|
+
value="4"
|
|
69
|
+
>
|
|
70
|
+
4
|
|
71
|
+
</a>
|
|
72
|
+
<a
|
|
73
|
+
aria-current="false"
|
|
74
|
+
aria-disabled="false"
|
|
75
|
+
class="item"
|
|
76
|
+
tabindex="0"
|
|
77
|
+
type="pageItem"
|
|
78
|
+
value="5"
|
|
79
|
+
>
|
|
80
|
+
5
|
|
81
|
+
</a>
|
|
82
|
+
<a
|
|
83
|
+
aria-current="false"
|
|
84
|
+
aria-disabled="false"
|
|
85
|
+
class="item"
|
|
86
|
+
tabindex="0"
|
|
87
|
+
type="pageItem"
|
|
88
|
+
value="6"
|
|
89
|
+
>
|
|
90
|
+
6
|
|
91
|
+
</a>
|
|
92
|
+
<a
|
|
93
|
+
aria-current="false"
|
|
94
|
+
aria-disabled="false"
|
|
95
|
+
aria-label="Next item"
|
|
96
|
+
class="item"
|
|
97
|
+
tabindex="0"
|
|
98
|
+
type="nextItem"
|
|
99
|
+
value="2"
|
|
100
|
+
>
|
|
101
|
+
⟩
|
|
102
|
+
</a>
|
|
103
|
+
<a
|
|
104
|
+
aria-current="false"
|
|
105
|
+
aria-disabled="false"
|
|
106
|
+
aria-label="Last item"
|
|
107
|
+
class="item"
|
|
108
|
+
tabindex="0"
|
|
109
|
+
type="lastItem"
|
|
110
|
+
value="6"
|
|
111
|
+
>
|
|
112
|
+
»
|
|
113
|
+
</a>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
38
116
|
`;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<SearchResults /> it matches the last snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
id="search.not_found.header"
|
|
15
|
-
/>
|
|
16
|
-
</MessageHeader>
|
|
17
|
-
<Link
|
|
18
|
-
className="link pointer"
|
|
19
|
-
to="/search"
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui icon message"
|
|
7
|
+
>
|
|
8
|
+
<i
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
class="search icon"
|
|
11
|
+
/>
|
|
12
|
+
<div
|
|
13
|
+
class="content"
|
|
20
14
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
<div
|
|
16
|
+
class="header"
|
|
17
|
+
>
|
|
18
|
+
No results found
|
|
19
|
+
</div>
|
|
20
|
+
<a
|
|
21
|
+
class="link pointer"
|
|
22
|
+
href="/search"
|
|
23
|
+
>
|
|
24
|
+
Try another search
|
|
25
|
+
</a>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
27
29
|
`;
|