@truedat/dd 7.0.8 → 7.1.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 +6 -6
- package/src/components/StructuresBulkUpdate.js +1 -1
- package/src/components/StructuresSearchResults.js +5 -3
- package/src/components/StructuresTable.js +1 -1
- package/src/components/__tests__/GrantApprovalRules.spec.js +16 -13
- package/src/components/__tests__/StructureGrantSummaryButton.spec.js +20 -20
- package/src/components/__tests__/StructureSelector.spec.js +3 -0
- package/src/components/__tests__/StructuresBulkUpdate.spec.js +22 -11
- package/src/components/__tests__/StructuresGrantRequestView.spec.js +3 -0
- package/src/components/__tests__/StructuresSearchResults.spec.js +5 -1
- package/src/components/__tests__/__snapshots__/ReferenceDataset.spec.js.snap +2 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetActions.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetHeader.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetRoutes.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/StructureNoteActions.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/StructureSelector.spec.js.snap +0 -12
- package/src/components/__tests__/__snapshots__/StructuresGrantRequestView.spec.js.snap +0 -12
- package/src/components/__tests__/__snapshots__/StructuresSearchResults.spec.js.snap +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "7.0
|
|
37
|
+
"@truedat/test": "7.1.0",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@apollo/client": "^3.7.1",
|
|
91
|
-
"@truedat/auth": "7.0
|
|
92
|
-
"@truedat/core": "7.0
|
|
93
|
-
"@truedat/df": "7.0
|
|
91
|
+
"@truedat/auth": "7.1.0",
|
|
92
|
+
"@truedat/core": "7.1.0",
|
|
93
|
+
"@truedat/df": "7.1.0",
|
|
94
94
|
"lodash": "^4.17.21",
|
|
95
95
|
"moment": "^2.29.4",
|
|
96
96
|
"path-to-regexp": "^1.7.0",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"react-dom": ">= 16.8.6 < 17",
|
|
116
116
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "cb08380da04c7286e694540bc24d32f01a728dfc"
|
|
119
119
|
}
|
|
@@ -21,9 +21,11 @@ export const StructuresSearchResults = ({
|
|
|
21
21
|
selectable,
|
|
22
22
|
}) => (
|
|
23
23
|
<Dimmer.Dimmable dimmed={loading} className="structure-table-overflow">
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
24
|
+
{loading ? (
|
|
25
|
+
<Dimmer active={loading} inverted>
|
|
26
|
+
<Loader size="large" />
|
|
27
|
+
</Dimmer>
|
|
28
|
+
) : null}
|
|
27
29
|
{!_.isEmpty(structures) || !_.isEmpty(selectedStructure) ? (
|
|
28
30
|
<>
|
|
29
31
|
<StructuresLabelResults />
|
|
@@ -57,10 +57,11 @@ describe("<GrantApprovalRules />", () => {
|
|
|
57
57
|
<GrantApprovalRules />,
|
|
58
58
|
renderOpts(grantApprovalRules)
|
|
59
59
|
);
|
|
60
|
-
|
|
61
|
-
await waitFor(() =>
|
|
62
|
-
expect(queryByText(/
|
|
63
|
-
|
|
60
|
+
|
|
61
|
+
await waitFor(() => {
|
|
62
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
63
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
64
|
+
});
|
|
64
65
|
expect(container).toMatchSnapshot();
|
|
65
66
|
});
|
|
66
67
|
|
|
@@ -69,22 +70,24 @@ describe("<GrantApprovalRules />", () => {
|
|
|
69
70
|
<GrantApprovalRules />,
|
|
70
71
|
renderOpts(emptyGrantApprovalRules)
|
|
71
72
|
);
|
|
72
|
-
|
|
73
|
-
await waitFor(() =>
|
|
74
|
-
expect(queryByText(/
|
|
75
|
-
|
|
73
|
+
|
|
74
|
+
await waitFor(() => {
|
|
75
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
76
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
77
|
+
});
|
|
76
78
|
expect(container).toMatchSnapshot();
|
|
77
79
|
});
|
|
78
80
|
|
|
79
81
|
it("renders ApprovalRule name as Link", async () => {
|
|
80
|
-
const { queryByText, getByText } = render(
|
|
82
|
+
const { container, queryByText, getByText } = render(
|
|
81
83
|
<GrantApprovalRules />,
|
|
82
84
|
renderOpts(grantApprovalRules)
|
|
83
85
|
);
|
|
84
|
-
|
|
85
|
-
await waitFor(() =>
|
|
86
|
-
expect(queryByText(/
|
|
87
|
-
|
|
86
|
+
|
|
87
|
+
await waitFor(() => {
|
|
88
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
89
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
90
|
+
});
|
|
88
91
|
|
|
89
92
|
const link = getByText("rule_name");
|
|
90
93
|
expect(link).toHaveAttribute("href", "/grantApproveRules/123");
|
|
@@ -51,10 +51,10 @@ describe("<StructureGrantSummaryButton />", () => {
|
|
|
51
51
|
renderOpts
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
await waitFor(() =>
|
|
55
|
-
|
|
56
|
-
expect(
|
|
57
|
-
);
|
|
54
|
+
await waitFor(() => {
|
|
55
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
56
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
57
|
+
});
|
|
58
58
|
|
|
59
59
|
expectToRenderDropdownComponent(container);
|
|
60
60
|
expect(container).toMatchSnapshot();
|
|
@@ -67,10 +67,10 @@ describe("<StructureGrantSummaryButton />", () => {
|
|
|
67
67
|
<StructureGrantSummaryButton />,
|
|
68
68
|
renderOpts
|
|
69
69
|
);
|
|
70
|
-
await waitFor(() =>
|
|
71
|
-
|
|
72
|
-
expect(
|
|
73
|
-
);
|
|
70
|
+
await waitFor(() => {
|
|
71
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
72
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
73
|
+
});
|
|
74
74
|
|
|
75
75
|
expectToRenderDropdownComponent(container);
|
|
76
76
|
expect(container).toMatchSnapshot();
|
|
@@ -83,10 +83,10 @@ describe("<StructureGrantSummaryButton />", () => {
|
|
|
83
83
|
<StructureGrantSummaryButton />,
|
|
84
84
|
renderOpts
|
|
85
85
|
);
|
|
86
|
-
await waitFor(() =>
|
|
87
|
-
|
|
88
|
-
expect(
|
|
89
|
-
);
|
|
86
|
+
await waitFor(() => {
|
|
87
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
88
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
89
|
+
});
|
|
90
90
|
|
|
91
91
|
expectToRenderDropdownComponent(container);
|
|
92
92
|
expect(container).toMatchSnapshot();
|
|
@@ -99,10 +99,10 @@ describe("<StructureGrantSummaryButton />", () => {
|
|
|
99
99
|
<StructureGrantSummaryButton />,
|
|
100
100
|
renderOpts
|
|
101
101
|
);
|
|
102
|
-
await waitFor(() =>
|
|
103
|
-
|
|
104
|
-
expect(
|
|
105
|
-
);
|
|
102
|
+
await waitFor(() => {
|
|
103
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
104
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
105
|
+
});
|
|
106
106
|
|
|
107
107
|
await expectToRenderRequestButton(container, getByRole);
|
|
108
108
|
expect(container).toMatchSnapshot();
|
|
@@ -115,10 +115,10 @@ describe("<StructureGrantSummaryButton />", () => {
|
|
|
115
115
|
<StructureGrantSummaryButton />,
|
|
116
116
|
renderOpts
|
|
117
117
|
);
|
|
118
|
-
await waitFor(() =>
|
|
119
|
-
|
|
120
|
-
expect(
|
|
121
|
-
);
|
|
118
|
+
await waitFor(() => {
|
|
119
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
120
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
121
|
+
});
|
|
122
122
|
|
|
123
123
|
await expectToRenderRequestButton(container, getByRole);
|
|
124
124
|
expect(container).toMatchSnapshot();
|
|
@@ -2,14 +2,20 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { waitFor } from "@testing-library/react";
|
|
4
4
|
import userEvent from "@testing-library/user-event";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
templateByNameMock,
|
|
7
|
+
emptyTemplateByNameMock,
|
|
8
|
+
} from "@truedat/test/mocks";
|
|
6
9
|
import { render } from "@truedat/test/render";
|
|
7
10
|
import StructuresBulkUpdate from "../StructuresBulkUpdate";
|
|
8
11
|
import { bulkUpdateStructures } from "../../routines";
|
|
9
12
|
|
|
10
13
|
describe("<StructuresBulkUpdate />", () => {
|
|
11
14
|
const renderOpts = {
|
|
12
|
-
mocks: [
|
|
15
|
+
mocks: [
|
|
16
|
+
templateByNameMock({ name: "template1", domainIds: [1] }),
|
|
17
|
+
emptyTemplateByNameMock(),
|
|
18
|
+
],
|
|
13
19
|
state: {
|
|
14
20
|
previousStructureQuery: {
|
|
15
21
|
structureCount: 10,
|
|
@@ -31,10 +37,10 @@ describe("<StructuresBulkUpdate />", () => {
|
|
|
31
37
|
renderOpts
|
|
32
38
|
);
|
|
33
39
|
|
|
34
|
-
await waitFor(() =>
|
|
35
|
-
|
|
36
|
-
expect(
|
|
37
|
-
);
|
|
40
|
+
await waitFor(() => {
|
|
41
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
42
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
43
|
+
});
|
|
38
44
|
expect(container).toMatchSnapshot();
|
|
39
45
|
});
|
|
40
46
|
|
|
@@ -43,10 +49,14 @@ describe("<StructuresBulkUpdate />", () => {
|
|
|
43
49
|
"state.previousStructureQuery.allFilters",
|
|
44
50
|
() => ({})
|
|
45
51
|
)(renderOpts);
|
|
46
|
-
const { container, getByText } = render(
|
|
52
|
+
const { container, queryByText, getByText } = render(
|
|
47
53
|
<StructuresBulkUpdate />,
|
|
48
54
|
thisRenderOpts
|
|
49
55
|
);
|
|
56
|
+
await waitFor(() => {
|
|
57
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
58
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
59
|
+
});
|
|
50
60
|
const emptySearchText = getByText("Empty Search");
|
|
51
61
|
expect(emptySearchText).toBeInTheDocument();
|
|
52
62
|
expect(container).toMatchSnapshot();
|
|
@@ -66,10 +76,11 @@ describe("<StructuresBulkUpdate />", () => {
|
|
|
66
76
|
{ ...thisRenderOpts, dispatch }
|
|
67
77
|
);
|
|
68
78
|
|
|
69
|
-
await waitFor(() =>
|
|
70
|
-
|
|
71
|
-
expect(queryByText(/loading/i)).not.toBeInTheDocument()
|
|
72
|
-
|
|
79
|
+
await waitFor(() => {
|
|
80
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
81
|
+
expect(queryByText(/loading/i)).not.toBeInTheDocument();
|
|
82
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
83
|
+
});
|
|
73
84
|
|
|
74
85
|
userEvent.type(await findByRole("textbox"), "bar");
|
|
75
86
|
|
|
@@ -81,6 +81,9 @@ describe("<StructuresGrantRequestView />", () => {
|
|
|
81
81
|
await waitFor(() => {
|
|
82
82
|
expect(container.querySelector(".loading")).toBeNull();
|
|
83
83
|
});
|
|
84
|
+
await waitFor(() =>
|
|
85
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument()
|
|
86
|
+
);
|
|
84
87
|
await waitFor(() => expect(container).toMatchSnapshot());
|
|
85
88
|
|
|
86
89
|
const structure1Row = await queryByText(/structure_1/).closest("tr");
|
|
@@ -36,7 +36,7 @@ const searchProps = {
|
|
|
36
36
|
describe("<StructuresSearchResults />", () => {
|
|
37
37
|
const columns = [{ name: "foo", sort: { name: "name.raw" } }];
|
|
38
38
|
|
|
39
|
-
it("matches the latest snapshot", () => {
|
|
39
|
+
it("matches the latest snapshot", async () => {
|
|
40
40
|
const props = { structures, columns };
|
|
41
41
|
const { container } = render(
|
|
42
42
|
<SearchContextWrapper props={searchProps}>
|
|
@@ -44,6 +44,10 @@ describe("<StructuresSearchResults />", () => {
|
|
|
44
44
|
</SearchContextWrapper>,
|
|
45
45
|
renderOpts
|
|
46
46
|
);
|
|
47
|
+
|
|
48
|
+
await waitFor(() =>
|
|
49
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument()
|
|
50
|
+
);
|
|
47
51
|
expect(container).toMatchSnapshot();
|
|
48
52
|
});
|
|
49
53
|
|
|
@@ -62,6 +62,7 @@ exports[`<ReferenceDataset /> edit dataset view matches the latest snapshot 1`]
|
|
|
62
62
|
class="right aligned eight wide column"
|
|
63
63
|
>
|
|
64
64
|
<div
|
|
65
|
+
aria-disabled="false"
|
|
65
66
|
aria-expanded="false"
|
|
66
67
|
class="ui floating dropdown button icon group-actions"
|
|
67
68
|
role="listbox"
|
|
@@ -352,6 +353,7 @@ exports[`<ReferenceDataset /> show dataset view matches the latest snapshot 1`]
|
|
|
352
353
|
class="right aligned eight wide column"
|
|
353
354
|
>
|
|
354
355
|
<div
|
|
356
|
+
aria-disabled="false"
|
|
355
357
|
aria-expanded="false"
|
|
356
358
|
class="ui floating dropdown button icon group-actions"
|
|
357
359
|
role="listbox"
|
|
@@ -385,6 +385,7 @@ exports[`<ReferenceDatasetRoutes /> matches the latest snapshot (view route) 1`]
|
|
|
385
385
|
class="right aligned eight wide column"
|
|
386
386
|
>
|
|
387
387
|
<div
|
|
388
|
+
aria-disabled="false"
|
|
388
389
|
aria-expanded="false"
|
|
389
390
|
class="ui floating dropdown button icon group-actions"
|
|
390
391
|
role="listbox"
|
|
@@ -75,18 +75,6 @@ exports[`<StructureSelector /> matches the latest snapshot 1`] = `
|
|
|
75
75
|
<div
|
|
76
76
|
class="dimmable structure-table-overflow"
|
|
77
77
|
>
|
|
78
|
-
<div
|
|
79
|
-
class="ui inverted dimmer"
|
|
80
|
-
style=""
|
|
81
|
-
>
|
|
82
|
-
<div
|
|
83
|
-
class="content"
|
|
84
|
-
>
|
|
85
|
-
<div
|
|
86
|
-
class="ui large loader"
|
|
87
|
-
/>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
78
|
<div
|
|
91
79
|
class="ui label structures-label-results"
|
|
92
80
|
>
|
|
@@ -108,18 +108,6 @@ exports[`<StructuresGrantRequestView /> Clicking a grant request button triggers
|
|
|
108
108
|
<div
|
|
109
109
|
class="dimmable structure-table-overflow"
|
|
110
110
|
>
|
|
111
|
-
<div
|
|
112
|
-
class="ui inverted dimmer"
|
|
113
|
-
style=""
|
|
114
|
-
>
|
|
115
|
-
<div
|
|
116
|
-
class="content"
|
|
117
|
-
>
|
|
118
|
-
<div
|
|
119
|
-
class="ui large loader"
|
|
120
|
-
/>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
111
|
<div
|
|
124
112
|
class="ui label structures-label-results"
|
|
125
113
|
>
|
|
@@ -5,17 +5,6 @@ exports[`<StructuresSearchResults /> matches the latest snapshot 1`] = `
|
|
|
5
5
|
<div
|
|
6
6
|
class="dimmable structure-table-overflow"
|
|
7
7
|
>
|
|
8
|
-
<div
|
|
9
|
-
class="ui inverted dimmer"
|
|
10
|
-
>
|
|
11
|
-
<div
|
|
12
|
-
class="content"
|
|
13
|
-
>
|
|
14
|
-
<div
|
|
15
|
-
class="ui large loader"
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
8
|
<div
|
|
20
9
|
class="ui label structures-label-results"
|
|
21
10
|
>
|