@truedat/qx 6.6.0 → 6.6.1
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 +4 -4
- package/src/components/common/__tests__/ResourceSelector.spec.js +61 -10
- package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +6 -3
- package/src/components/common/expressions/__tests__/Expression.spec.js +2 -2
- package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +28 -2
- package/src/components/common/resourceSelectors/DataStructureSelector.js +1 -0
- package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +29 -0
- package/src/components/common/resourceSelectors/__tests__/ReferenceDatasetSelector.spec.js +1 -1
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +4 -1
- package/src/components/dataViews/queryableProperties/__tests__/GroupBy.spec.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/qx",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.1",
|
|
4
4
|
"description": "Truedat Web Quality Experience package",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/react-hooks": "^8.0.1",
|
|
37
37
|
"@testing-library/user-event": "^13.2.1",
|
|
38
|
-
"@truedat/test": "6.6.
|
|
38
|
+
"@truedat/test": "6.6.1",
|
|
39
39
|
"babel-jest": "^28.1.0",
|
|
40
40
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
41
41
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@truedat/core": "6.6.
|
|
87
|
+
"@truedat/core": "6.6.1",
|
|
88
88
|
"prop-types": "^15.8.1",
|
|
89
89
|
"react-hook-form": "^7.45.4",
|
|
90
90
|
"react-intl": "^5.20.10",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"react-dom": ">= 16.8.6 < 17",
|
|
98
98
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "2fa84eee80136fa3bd394c04153e6f16d2e5a1e0"
|
|
101
101
|
}
|
|
@@ -3,8 +3,35 @@ import { act } from "react-dom/test-utils";
|
|
|
3
3
|
import userEvent from "@testing-library/user-event";
|
|
4
4
|
import { render } from "@truedat/test/render";
|
|
5
5
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
|
+
import SearchContext from "@truedat/core/search/SearchContext";
|
|
6
7
|
import ResourceSelector from "../ResourceSelector";
|
|
7
8
|
|
|
9
|
+
jest.mock("@truedat/dd/hooks/useStructures", () => {
|
|
10
|
+
const originalModule = jest.requireActual("@truedat/dd/hooks/useStructures");
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
__esModule: true,
|
|
14
|
+
...originalModule,
|
|
15
|
+
useDataStructureFilters: () => ({
|
|
16
|
+
trigger: () => ({
|
|
17
|
+
then: (callback) =>
|
|
18
|
+
callback({
|
|
19
|
+
data: {},
|
|
20
|
+
}),
|
|
21
|
+
}),
|
|
22
|
+
}),
|
|
23
|
+
useDataStructureSearch: () => ({
|
|
24
|
+
trigger: () => ({
|
|
25
|
+
then: (callback) =>
|
|
26
|
+
callback({
|
|
27
|
+
data: { data: [] },
|
|
28
|
+
headers: {},
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
8
35
|
const renderOpts = {
|
|
9
36
|
messages: {
|
|
10
37
|
en: {
|
|
@@ -15,27 +42,40 @@ const renderOpts = {
|
|
|
15
42
|
"queryables.resource.type.data_view": "data_view",
|
|
16
43
|
"queryables.resource.selector.data_view": "data_view",
|
|
17
44
|
"queryables.resource.selector.reference_dataset": "reference_dataset",
|
|
45
|
+
"search.placeholder": "placeholder",
|
|
18
46
|
"structures.not_found.body": "body",
|
|
19
47
|
"structures.not_found.header": "header",
|
|
20
48
|
"structures.search.placeholder": "placeholder",
|
|
49
|
+
"structures.loading.header": "loading",
|
|
21
50
|
},
|
|
22
51
|
},
|
|
23
52
|
};
|
|
24
53
|
|
|
54
|
+
const searchProps = {
|
|
55
|
+
userFiltersType: "foo",
|
|
56
|
+
useFilters: jest.fn(),
|
|
57
|
+
useSearch: jest.fn(),
|
|
58
|
+
loadingFilters: false,
|
|
59
|
+
query: "",
|
|
60
|
+
setQuery: jest.fn(),
|
|
61
|
+
};
|
|
62
|
+
|
|
25
63
|
describe("<ResourceSelector />", () => {
|
|
26
64
|
it("matches the latest snapshot", () => {
|
|
27
65
|
const { container } = render(
|
|
28
66
|
<TestFormWrapper>
|
|
29
|
-
<
|
|
67
|
+
<SearchContext.Provider value={searchProps}>
|
|
68
|
+
<ResourceSelector />
|
|
69
|
+
</SearchContext.Provider>
|
|
30
70
|
</TestFormWrapper>,
|
|
31
71
|
renderOpts
|
|
32
72
|
);
|
|
33
|
-
|
|
34
73
|
expect(container).toMatchSnapshot();
|
|
35
74
|
});
|
|
36
75
|
|
|
37
76
|
it("select data_view", async () => {
|
|
38
77
|
const watcher = jest.fn();
|
|
78
|
+
|
|
39
79
|
const { container, getByRole } = render(
|
|
40
80
|
<TestFormWrapper
|
|
41
81
|
context={{
|
|
@@ -43,7 +83,9 @@ describe("<ResourceSelector />", () => {
|
|
|
43
83
|
}}
|
|
44
84
|
watcher={watcher}
|
|
45
85
|
>
|
|
46
|
-
<
|
|
86
|
+
<SearchContext.Provider value={searchProps}>
|
|
87
|
+
<ResourceSelector />
|
|
88
|
+
</SearchContext.Provider>
|
|
47
89
|
</TestFormWrapper>,
|
|
48
90
|
renderOpts
|
|
49
91
|
);
|
|
@@ -51,6 +93,7 @@ describe("<ResourceSelector />", () => {
|
|
|
51
93
|
await act(async () => {
|
|
52
94
|
userEvent.click(getByRole("option", { name: /data_view/i }));
|
|
53
95
|
});
|
|
96
|
+
|
|
54
97
|
await act(async () => {
|
|
55
98
|
userEvent.click(getByRole("option", { name: /UserDataView/i }));
|
|
56
99
|
});
|
|
@@ -73,14 +116,16 @@ describe("<ResourceSelector />", () => {
|
|
|
73
116
|
it("select data_structure", async () => {
|
|
74
117
|
const watcher = jest.fn();
|
|
75
118
|
const { container, getByRole } = render(
|
|
76
|
-
<TestFormWrapper>
|
|
77
|
-
<
|
|
119
|
+
<TestFormWrapper watcher={watcher}>
|
|
120
|
+
<SearchContext.Provider value={searchProps}>
|
|
121
|
+
<ResourceSelector />
|
|
122
|
+
</SearchContext.Provider>
|
|
78
123
|
</TestFormWrapper>,
|
|
79
124
|
renderOpts
|
|
80
125
|
);
|
|
81
126
|
|
|
82
127
|
await act(async () => {
|
|
83
|
-
userEvent.click(getByRole("option", { name: /data_structure/i }));
|
|
128
|
+
userEvent.click(await getByRole("option", { name: /data_structure/i }));
|
|
84
129
|
});
|
|
85
130
|
|
|
86
131
|
expect(container).toMatchSnapshot();
|
|
@@ -95,16 +140,23 @@ describe("<ResourceSelector />", () => {
|
|
|
95
140
|
}}
|
|
96
141
|
watcher={watcher}
|
|
97
142
|
>
|
|
98
|
-
<
|
|
143
|
+
<SearchContext.Provider value={searchProps}>
|
|
144
|
+
<ResourceSelector />
|
|
145
|
+
</SearchContext.Provider>
|
|
99
146
|
</TestFormWrapper>,
|
|
100
147
|
renderOpts
|
|
101
148
|
);
|
|
102
149
|
|
|
103
150
|
await act(async () => {
|
|
104
|
-
userEvent.click(
|
|
151
|
+
userEvent.click(
|
|
152
|
+
await getByRole("option", { name: /reference_dataset/i })
|
|
153
|
+
);
|
|
105
154
|
});
|
|
155
|
+
|
|
106
156
|
await act(async () => {
|
|
107
|
-
userEvent.click(
|
|
157
|
+
userEvent.click(
|
|
158
|
+
await getByRole("option", { name: /UserReferenceDataset/i })
|
|
159
|
+
);
|
|
108
160
|
});
|
|
109
161
|
|
|
110
162
|
expect(watcher).lastCalledWith({
|
|
@@ -118,7 +170,6 @@ describe("<ResourceSelector />", () => {
|
|
|
118
170
|
type: "reference_dataset",
|
|
119
171
|
},
|
|
120
172
|
});
|
|
121
|
-
|
|
122
173
|
expect(container).toMatchSnapshot();
|
|
123
174
|
});
|
|
124
175
|
});
|
|
@@ -83,8 +83,8 @@ exports[`<ResourceSelector /> select data_structure 1`] = `
|
|
|
83
83
|
resource
|
|
84
84
|
</label>
|
|
85
85
|
<div
|
|
86
|
-
aria-expanded="
|
|
87
|
-
class="ui
|
|
86
|
+
aria-expanded="false"
|
|
87
|
+
class="ui selection dropdown"
|
|
88
88
|
role="listbox"
|
|
89
89
|
tabindex="0"
|
|
90
90
|
>
|
|
@@ -101,7 +101,7 @@ exports[`<ResourceSelector /> select data_structure 1`] = `
|
|
|
101
101
|
class="dropdown icon"
|
|
102
102
|
/>
|
|
103
103
|
<div
|
|
104
|
-
class="
|
|
104
|
+
class="menu transition"
|
|
105
105
|
>
|
|
106
106
|
<div
|
|
107
107
|
aria-checked="true"
|
|
@@ -176,6 +176,8 @@ exports[`<ResourceSelector /> select data_structure 1`] = `
|
|
|
176
176
|
/>
|
|
177
177
|
</button>
|
|
178
178
|
<div
|
|
179
|
+
aria-busy="false"
|
|
180
|
+
aria-disabled="false"
|
|
179
181
|
aria-expanded="false"
|
|
180
182
|
class="ui button floating labeled scrolling dropdown icon"
|
|
181
183
|
role="listbox"
|
|
@@ -215,6 +217,7 @@ exports[`<ResourceSelector /> select data_structure 1`] = `
|
|
|
215
217
|
>
|
|
216
218
|
<div
|
|
217
219
|
class="ui inverted dimmer"
|
|
220
|
+
style=""
|
|
218
221
|
>
|
|
219
222
|
<div
|
|
220
223
|
class="content"
|
|
@@ -54,8 +54,8 @@ describe("<Expression />", () => {
|
|
|
54
54
|
</TestFormWrapper>,
|
|
55
55
|
renderOpts
|
|
56
56
|
);
|
|
57
|
-
userEvent.click(getAllByRole("listbox")[1]);
|
|
58
|
-
userEvent.click(getByRole("option", { name: /eq/i }));
|
|
57
|
+
userEvent.click(await getAllByRole("listbox")[1]);
|
|
58
|
+
userEvent.click(await getByRole("option", { name: /eq/i }));
|
|
59
59
|
|
|
60
60
|
expect(watcher).lastCalledWith({
|
|
61
61
|
test: {
|
|
@@ -5,6 +5,32 @@ import userEvent from "@testing-library/user-event";
|
|
|
5
5
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
6
|
import FunctionArgs from "../FunctionArgs";
|
|
7
7
|
|
|
8
|
+
jest.mock("@truedat/dd/hooks/useStructures", () => {
|
|
9
|
+
const originalModule = jest.requireActual("@truedat/dd/hooks/useStructures");
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
__esModule: true,
|
|
13
|
+
...originalModule,
|
|
14
|
+
useDataStructureFilters: () => ({
|
|
15
|
+
trigger: () => ({
|
|
16
|
+
then: (callback) =>
|
|
17
|
+
callback({
|
|
18
|
+
data: {},
|
|
19
|
+
}),
|
|
20
|
+
}),
|
|
21
|
+
}),
|
|
22
|
+
useDataStructureSearch: () => ({
|
|
23
|
+
trigger: () => ({
|
|
24
|
+
then: (callback) =>
|
|
25
|
+
callback({
|
|
26
|
+
data: { data: [] },
|
|
27
|
+
headers: {},
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
8
34
|
const renderOpts = {
|
|
9
35
|
messages: {
|
|
10
36
|
en: {
|
|
@@ -72,8 +98,8 @@ describe("<FunctionArgs />", () => {
|
|
|
72
98
|
);
|
|
73
99
|
await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
|
|
74
100
|
|
|
75
|
-
userEvent.click(getAllByRole("listbox")[0]);
|
|
76
|
-
userEvent.click(getAllByRole("option", { name: /constant/i })[0]);
|
|
101
|
+
userEvent.click(await getAllByRole("listbox")[0]);
|
|
102
|
+
userEvent.click(await getAllByRole("option", { name: /constant/i })[0]);
|
|
77
103
|
|
|
78
104
|
expect(watcher).lastCalledWith({
|
|
79
105
|
test: {
|
|
@@ -4,13 +4,42 @@ import { render } from "@truedat/test/render";
|
|
|
4
4
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
5
5
|
import DataStructureSelector from "../DataStructureSelector";
|
|
6
6
|
|
|
7
|
+
jest.mock("@truedat/dd/hooks/useStructures", () => {
|
|
8
|
+
const originalModule = jest.requireActual("@truedat/dd/hooks/useStructures");
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
__esModule: true,
|
|
12
|
+
...originalModule,
|
|
13
|
+
useDataStructureFilters: () => ({
|
|
14
|
+
trigger: () => ({
|
|
15
|
+
then: (callback) =>
|
|
16
|
+
callback({
|
|
17
|
+
data: {},
|
|
18
|
+
}),
|
|
19
|
+
}),
|
|
20
|
+
}),
|
|
21
|
+
useDataStructureSearch: () => ({
|
|
22
|
+
trigger: () => ({
|
|
23
|
+
then: (callback) =>
|
|
24
|
+
callback({
|
|
25
|
+
data: { data: [] },
|
|
26
|
+
headers: {},
|
|
27
|
+
}),
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
7
33
|
const renderOpts = {
|
|
8
34
|
messages: {
|
|
9
35
|
en: {
|
|
10
36
|
"queryables.resource.selector.data_structure": "data_structure",
|
|
37
|
+
"search.placeholder": "search placeholder",
|
|
11
38
|
"structures.not_found.body": "body",
|
|
39
|
+
"structures.loading.header": "loading",
|
|
12
40
|
"structures.search.placeholder": "placeholder",
|
|
13
41
|
"structures.not_found.header": "header",
|
|
42
|
+
"structures.loading.header": "loading",
|
|
14
43
|
},
|
|
15
44
|
},
|
|
16
45
|
};
|
|
@@ -20,7 +20,7 @@ exports[`<DataStructureSelector /> matches the latest snapshot 1`] = `
|
|
|
20
20
|
class="search link icon"
|
|
21
21
|
/>
|
|
22
22
|
<input
|
|
23
|
-
placeholder="placeholder"
|
|
23
|
+
placeholder="search placeholder"
|
|
24
24
|
type="text"
|
|
25
25
|
value=""
|
|
26
26
|
/>
|
|
@@ -33,6 +33,8 @@ exports[`<DataStructureSelector /> matches the latest snapshot 1`] = `
|
|
|
33
33
|
/>
|
|
34
34
|
</button>
|
|
35
35
|
<div
|
|
36
|
+
aria-busy="false"
|
|
37
|
+
aria-disabled="false"
|
|
36
38
|
aria-expanded="false"
|
|
37
39
|
class="ui button floating labeled scrolling dropdown icon"
|
|
38
40
|
role="listbox"
|
|
@@ -72,6 +74,7 @@ exports[`<DataStructureSelector /> matches the latest snapshot 1`] = `
|
|
|
72
74
|
>
|
|
73
75
|
<div
|
|
74
76
|
class="ui inverted dimmer"
|
|
77
|
+
style=""
|
|
75
78
|
>
|
|
76
79
|
<div
|
|
77
80
|
class="content"
|
|
@@ -26,7 +26,7 @@ const renderOpts = {
|
|
|
26
26
|
|
|
27
27
|
describe("<GroupBy />", () => {
|
|
28
28
|
it("matches the latest snapshot", async () => {
|
|
29
|
-
const { container,
|
|
29
|
+
const { container, getByRole, getAllByRole } = render(
|
|
30
30
|
<TestFormWrapper
|
|
31
31
|
context={{
|
|
32
32
|
field: "queryables[0].properties",
|