@truedat/df 8.12.5 → 8.12.7
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/FieldGroupWithTranslations.js +1 -1
- package/src/components/FieldViewerValue.js +2 -1
- package/src/components/SelectDynamicFormWithTranslations.js +1 -1
- package/src/components/SelectableDynamicForm.js +1 -1
- package/src/components/__tests__/DynamicForm.spec.js +2 -1
- package/src/components/__tests__/DynamicFormWithTranslations.spec.js +2 -9
- package/src/components/__tests__/EditableDynamicFieldValue.spec.js +1 -1
- package/src/components/__tests__/FieldGroupDetail.spec.js +1 -1
- package/src/components/__tests__/SelectDynamicFormWithTranslations.spec.js +7 -9
- package/src/components/hierarchies/Hierarchies.js +1 -1
- package/src/components/hierarchies/HierarchyView.js +3 -3
- package/src/components/widgets/DomainDropdown.js +1 -1
- package/src/components/widgets/DynamicField.js +1 -1
- package/src/components/widgets/HierarchyDropdown.js +1 -1
- package/src/components/widgets/MarkdownField.js +1 -1
- package/src/components/widgets/__tests__/CheckboxField.spec.js +2 -1
- package/src/components/widgets/__tests__/ColorPickerField.spec.js +2 -1
- package/src/components/widgets/__tests__/DateField.spec.js +2 -1
- package/src/components/widgets/__tests__/DateTimeField.spec.js +2 -1
- package/src/components/widgets/__tests__/DropdownDataLoader.spec.js +2 -1
- package/src/components/widgets/__tests__/DynamicTableField.spec.js +20 -7
- package/src/components/widgets/__tests__/HierarchyDropdown.spec.js +1 -1
- package/src/components/widgets/__tests__/HierarchyPreview.spec.js +2 -2
- package/src/components/widgets/__tests__/ImageField.spec.js +2 -1
- package/src/components/widgets/__tests__/NumberField.spec.js +5 -4
- package/src/components/widgets/__tests__/PairListField.spec.js +2 -1
- package/src/components/widgets/__tests__/PasswordField.spec.js +1 -1
- package/src/components/widgets/__tests__/RadioField.spec.js +2 -1
- package/src/components/widgets/__tests__/StandardDropdown.spec.js +2 -1
- package/src/components/widgets/__tests__/StringField.spec.js +2 -1
- package/src/components/widgets/__tests__/TableField.spec.js +2 -1
- package/src/components/widgets/__tests__/TextField.spec.js +2 -1
- package/src/templates/components/Template.js +1 -1
- package/src/templates/components/TemplateLoader.js +1 -1
- package/src/templates/components/templateForm/FieldForm.js +1 -1
- package/src/templates/components/templateForm/__tests__/ActiveGroupForm.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/DefaultValue.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/DependentDomain.spec.js +3 -3
- package/src/templates/components/templateForm/__tests__/DependentFormField.spec.js +1 -1
- package/src/templates/components/templateForm/__tests__/FieldDefinition.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/FieldForm.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/GroupsList.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/MandatoryConditional.spec.js +3 -3
- package/src/templates/components/templateForm/__tests__/SwitchListForm.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/SwitchSegment.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/TableValuesForm.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/TemplateRelationsForm.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/ValuesListForm.spec.js +2 -1
- package/src/templates/components/templateForm/__tests__/ValuesSelector.spec.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/df",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.7",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"@testing-library/jest-dom": "^6.6.3",
|
|
55
55
|
"@testing-library/react": "^16.3.0",
|
|
56
56
|
"@testing-library/user-event": "^14.6.1",
|
|
57
|
-
"@truedat/test": "8.12.
|
|
57
|
+
"@truedat/test": "8.12.7",
|
|
58
58
|
"identity-obj-proxy": "^3.0.0",
|
|
59
59
|
"jest": "^29.7.0",
|
|
60
60
|
"redux-saga-test-plan": "^4.0.6"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@apollo/client": "^3.13.8",
|
|
64
|
-
"@truedat/core": "8.12.
|
|
64
|
+
"@truedat/core": "8.12.7",
|
|
65
65
|
"axios": "^1.15.0",
|
|
66
66
|
"graphql": "^16.11.0",
|
|
67
67
|
"is-hotkey": "^0.2.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"semantic-ui-react": "^3.0.0-beta.2",
|
|
91
91
|
"swr": "^2.3.3"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "dae06fd2f915163d5f1e7e3f26c414c8ee9bf055"
|
|
94
94
|
}
|
|
@@ -2,7 +2,7 @@ import PropTypes from "prop-types";
|
|
|
2
2
|
import { Segment, Header, Grid, Tab } from "semantic-ui-react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { useLanguage, I18nProvider } from "@truedat/core/i18n";
|
|
5
|
-
import
|
|
5
|
+
import LanguagesTabs from "@truedat/core/components/LanguagesTabs";
|
|
6
6
|
import {
|
|
7
7
|
hasTranslatableFields,
|
|
8
8
|
isTranslatableField,
|
|
@@ -2,7 +2,8 @@ import _ from "lodash";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { Icon, Label, Table } from "semantic-ui-react";
|
|
5
|
-
import { MarkdownReader
|
|
5
|
+
import { MarkdownReader } from "@truedat/core/components/MarkdownReader";
|
|
6
|
+
import SafeLink from "@truedat/core/components/SafeLink";
|
|
6
7
|
import ImagePreview from "./widgets/ImagePreview";
|
|
7
8
|
import SystemPreview from "./widgets/SystemPreview";
|
|
8
9
|
|
|
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Grid, Header } from "semantic-ui-react";
|
|
5
|
-
import
|
|
5
|
+
import TemplateSelector from "@truedat/core/components/TemplateSelector";
|
|
6
6
|
import { applyTemplate, validateContent } from "@truedat/df/utils";
|
|
7
7
|
import { useLanguage } from "@truedat/core/i18n";
|
|
8
8
|
import { useIntl } from "react-intl";
|
|
@@ -3,7 +3,7 @@ import { useState, useRef, useEffect } from "react";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { useQuery } from "@apollo/client";
|
|
5
5
|
import { TEMPLATES_QUERY } from "@truedat/core/api/queries";
|
|
6
|
-
import
|
|
6
|
+
import TemplateSelector from "@truedat/core/components/TemplateSelector";
|
|
7
7
|
import { validateContent } from "@truedat/df/utils";
|
|
8
8
|
import DynamicForm from "./DynamicForm";
|
|
9
9
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fireEvent, waitFor } from "@testing-library/react";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { DynamicForm } from "../DynamicForm";
|
|
4
5
|
|
|
5
6
|
jest.mock("../widgets/FieldByWidget", () => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fireEvent, waitFor } from "@testing-library/react";
|
|
2
|
-
import { render } from "@truedat/test/
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
3
|
import { DynamicFormWithTranslations } from "../DynamicFormWithTranslations";
|
|
4
4
|
|
|
5
5
|
jest.mock("@truedat/core/i18n", () => {
|
|
@@ -43,14 +43,7 @@ jest.mock("../widgets/FieldByWidget", () => ({
|
|
|
43
43
|
),
|
|
44
44
|
}));
|
|
45
45
|
|
|
46
|
-
jest.mock("@truedat/core/components", () =>
|
|
47
|
-
const originalModule = jest.requireActual("@truedat/core/components");
|
|
48
|
-
return {
|
|
49
|
-
__esModule: true,
|
|
50
|
-
...originalModule,
|
|
51
|
-
LanguagesTabs: () => null,
|
|
52
|
-
};
|
|
53
|
-
});
|
|
46
|
+
jest.mock("@truedat/core/components/LanguagesTabs", () => () => null);
|
|
54
47
|
|
|
55
48
|
describe("<DynamicFormWithTranslations /> markdown", () => {
|
|
56
49
|
it("calls onChange with the updated markdown per language", async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { waitFor } from "@testing-library/react";
|
|
2
|
-
import { render } from "@truedat/test/
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
3
|
import { markdownToHtml } from "@truedat/core/components/Markdown";
|
|
4
4
|
import { EditableDynamicFieldValue } from "../EditableDynamicFieldValue";
|
|
5
5
|
|
|
@@ -33,18 +33,16 @@ jest.mock("react-intl", () => ({
|
|
|
33
33
|
}),
|
|
34
34
|
}));
|
|
35
35
|
|
|
36
|
-
jest.mock("@truedat/core/components", () => {
|
|
36
|
+
jest.mock("@truedat/core/components/TemplateSelector", () => {
|
|
37
37
|
const React = require("react");
|
|
38
38
|
|
|
39
|
-
return {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, []);
|
|
39
|
+
return ({ onLoad }) => {
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
onLoad({ templates: [mockTemplate] });
|
|
42
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
|
+
}, []);
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
},
|
|
45
|
+
return null;
|
|
48
46
|
};
|
|
49
47
|
});
|
|
50
48
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Table } from "semantic-ui-react";
|
|
2
2
|
import { Link } from "react-router";
|
|
3
|
-
import
|
|
3
|
+
import Loading from "@truedat/core/components/Loading";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
5
|
import { linkTo } from "@truedat/core/routes";
|
|
6
6
|
import { useHierarchies } from "@truedat/core/hooks/useHierarchies";
|
|
@@ -5,9 +5,9 @@ import { Button, Header, Icon, Segment } from "semantic-ui-react";
|
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { Link } from "react-router";
|
|
7
7
|
import { linkTo } from "@truedat/core/routes";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import CSVFileModal from "@truedat/core/components/CSVFileModal";
|
|
9
|
+
import HistoryBackButton from "@truedat/core/components/HistoryBackButton";
|
|
10
|
+
import ConfirmModal from "@truedat/core/components/ConfirmModal";
|
|
11
11
|
import Hierarchy from "@truedat/core/components/Hierarchy";
|
|
12
12
|
import HierarchyCrumbs from "./HierarchyCrumbs";
|
|
13
13
|
|
|
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Form } from "semantic-ui-react";
|
|
5
|
-
import
|
|
5
|
+
import DomainSelector from "@truedat/core/components/DomainSelector";
|
|
6
6
|
|
|
7
7
|
const toIntegerId = _.cond([
|
|
8
8
|
[_.isInteger, _.identity],
|
|
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { Form, Icon, Popup, Label } from "semantic-ui-react";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
|
-
import { MarkdownReader } from "@truedat/core/components";
|
|
5
|
+
import { MarkdownReader } from "@truedat/core/components/MarkdownReader";
|
|
6
6
|
import OriginLabel from "@truedat/core/components/OriginLabel";
|
|
7
7
|
import FieldByWidget from "./FieldByWidget";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Form } from "semantic-ui-react";
|
|
5
|
-
import
|
|
5
|
+
import HierarchySelector from "@truedat/core/components/HierarchySelector";
|
|
6
6
|
|
|
7
7
|
const pickId = _.cond([
|
|
8
8
|
[_.eq(""), _.constant(null)],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
|
-
import { MarkdownEditor } from "@truedat/core/components";
|
|
2
|
+
import { MarkdownEditor } from "@truedat/core/components/Markdown";
|
|
3
3
|
|
|
4
4
|
export const MarkdownField = ({ field: { name, value }, onChange }) => (
|
|
5
5
|
<MarkdownEditor name={name} value={value || ""} onChange={onChange} />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { CheckboxField } from "../CheckboxField";
|
|
4
5
|
|
|
5
6
|
describe("<CheckboxField />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { ColorPickerField } from "../ColorPickerField";
|
|
3
4
|
|
|
4
5
|
describe("<ColorPickerField />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { DateField } from "../DateField";
|
|
3
4
|
|
|
4
5
|
describe("<DateField />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { DateTimeField } from "../DateTimeField";
|
|
3
4
|
|
|
4
5
|
describe("<DateTimeField />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { DropdownDataLoader } from "../DropdownDataLoader";
|
|
3
4
|
|
|
4
5
|
describe("<DropdownDataLoader />", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { screen, fireEvent, within } from "@testing-library/react";
|
|
4
5
|
import userEvent from "@testing-library/user-event";
|
|
5
6
|
import DynamicTableField from "../DynamicTableField";
|
|
@@ -50,7 +51,9 @@ describe("DynamicTableField", () => {
|
|
|
50
51
|
scope: "test",
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
const rendered = render(<DynamicTableField {...props}
|
|
54
|
+
const rendered = render(<DynamicTableField {...props} />, {
|
|
55
|
+
fallback: <div>loading</div>,
|
|
56
|
+
});
|
|
54
57
|
await waitForLoad(rendered);
|
|
55
58
|
expect(rendered.container).toMatchSnapshot();
|
|
56
59
|
|
|
@@ -81,7 +84,9 @@ describe("DynamicTableField", () => {
|
|
|
81
84
|
scope: "test",
|
|
82
85
|
};
|
|
83
86
|
|
|
84
|
-
const rendered = render(<DynamicTableField {...props}
|
|
87
|
+
const rendered = render(<DynamicTableField {...props} />, {
|
|
88
|
+
fallback: <div>loading</div>,
|
|
89
|
+
});
|
|
85
90
|
await waitForLoad(rendered);
|
|
86
91
|
const addButton = rendered.getByTestId("add-button");
|
|
87
92
|
await user.click(addButton);
|
|
@@ -114,7 +119,9 @@ describe("DynamicTableField", () => {
|
|
|
114
119
|
scope: "test",
|
|
115
120
|
};
|
|
116
121
|
|
|
117
|
-
const rendered = render(<DynamicTableField {...props}
|
|
122
|
+
const rendered = render(<DynamicTableField {...props} />, {
|
|
123
|
+
fallback: <div>loading</div>,
|
|
124
|
+
});
|
|
118
125
|
await waitForLoad(rendered);
|
|
119
126
|
|
|
120
127
|
const firstRow = rendered.container.querySelector("tbody tr");
|
|
@@ -154,7 +161,9 @@ describe("DynamicTableField", () => {
|
|
|
154
161
|
scope: "test",
|
|
155
162
|
};
|
|
156
163
|
|
|
157
|
-
const rendered = render(<DynamicTableField {...props}
|
|
164
|
+
const rendered = render(<DynamicTableField {...props} />, {
|
|
165
|
+
fallback: <div>loading</div>,
|
|
166
|
+
});
|
|
158
167
|
await waitForLoad(rendered);
|
|
159
168
|
|
|
160
169
|
const input = rendered.getAllByTestId("cell-input-col1")[0];
|
|
@@ -202,7 +211,9 @@ describe("DynamicTableField", () => {
|
|
|
202
211
|
scope: "test",
|
|
203
212
|
};
|
|
204
213
|
|
|
205
|
-
const rendered = render(<DynamicTableField {...props}
|
|
214
|
+
const rendered = render(<DynamicTableField {...props} />, {
|
|
215
|
+
fallback: <div>loading</div>,
|
|
216
|
+
});
|
|
206
217
|
await waitForLoad(rendered);
|
|
207
218
|
|
|
208
219
|
// Trigger a change on col2; this will call handleChange → removeDeletedColumns
|
|
@@ -239,7 +250,9 @@ describe("DynamicTableField", () => {
|
|
|
239
250
|
scope: "test",
|
|
240
251
|
};
|
|
241
252
|
|
|
242
|
-
const rendered = render(<DynamicTableField {...props}
|
|
253
|
+
const rendered = render(<DynamicTableField {...props} />, {
|
|
254
|
+
fallback: <div>loading</div>,
|
|
255
|
+
});
|
|
243
256
|
await waitForLoad(rendered);
|
|
244
257
|
|
|
245
258
|
// Footer add button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { render } from "@truedat/test/
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
2
|
import { waitFor } from "@testing-library/react";
|
|
3
3
|
import userEvent from "@testing-library/user-event";
|
|
4
4
|
import HierarchyPreview from "../HierarchyPreview";
|
|
@@ -20,7 +20,7 @@ describe("<HierarchyPreview />", () => {
|
|
|
20
20
|
|
|
21
21
|
it("show tooltip", async () => {
|
|
22
22
|
const { getByText } = render(<HierarchyPreview {...props} />);
|
|
23
|
-
userEvent.hover(
|
|
23
|
+
await userEvent.hover(getByText("xyz"));
|
|
24
24
|
await waitFor(() => expect(getByText("baz")).toBeInTheDocument());
|
|
25
25
|
});
|
|
26
26
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { ImageField } from "../ImageField";
|
|
3
4
|
|
|
4
5
|
describe("<ImageField />", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { NumberField } from "../NumberField";
|
|
4
5
|
|
|
5
6
|
describe("<NumberField />", () => {
|
|
@@ -25,11 +26,11 @@ describe("<NumberField />", () => {
|
|
|
25
26
|
const numberInput = rendered.container.querySelector(
|
|
26
27
|
'input[type="number"]',
|
|
27
28
|
);
|
|
28
|
-
userEvent.clear(numberInput);
|
|
29
|
-
userEvent.type(numberInput, "42");
|
|
29
|
+
await userEvent.clear(numberInput);
|
|
30
|
+
await userEvent.type(numberInput, "42");
|
|
30
31
|
|
|
31
32
|
// Trigger blur to ensure the change is applied
|
|
32
|
-
userEvent.tab();
|
|
33
|
+
await userEvent.tab();
|
|
33
34
|
|
|
34
35
|
expect(onChange).toHaveBeenCalled();
|
|
35
36
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { PairListField } from "../PairListField";
|
|
4
5
|
|
|
5
6
|
describe("<PairListField />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { RadioField } from "../RadioField";
|
|
3
4
|
|
|
4
5
|
describe("<RadioField />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { StandardDropdown } from "../StandardDropdown";
|
|
3
4
|
|
|
4
5
|
describe("<StandardDropdown />", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { StringField } from "../StringField";
|
|
4
5
|
|
|
5
6
|
describe("<StringField />", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { TableField } from "../TableField";
|
|
4
5
|
|
|
5
6
|
describe("<TableField />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { TextField } from "../TextField";
|
|
3
4
|
|
|
4
5
|
describe("<TextField />", () => {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "semantic-ui-react";
|
|
12
12
|
import { connect } from "react-redux";
|
|
13
13
|
import { useNavigate } from "react-router";
|
|
14
|
-
import
|
|
14
|
+
import ConfirmModal from "@truedat/core/components/ConfirmModal";
|
|
15
15
|
import { TEMPLATES } from "@truedat/core/routes";
|
|
16
16
|
import { deleteTemplate, updateTemplate } from "../routines";
|
|
17
17
|
import TemplateCrumbs from "./TemplateCrumbs";
|
|
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { useParams } from "react-router";
|
|
4
4
|
import { useDispatch, useSelector } from "react-redux";
|
|
5
|
-
import
|
|
5
|
+
import Loading from "@truedat/core/components/Loading";
|
|
6
6
|
import { fetchTemplate } from "../routines";
|
|
7
7
|
|
|
8
8
|
export function TemplateLoader() {
|
|
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
4
4
|
import { Form, Button, Divider, Label, Segment } from "semantic-ui-react";
|
|
5
|
-
import { MarkdownEditor } from "@truedat/core/components";
|
|
5
|
+
import { MarkdownEditor } from "@truedat/core/components/Markdown";
|
|
6
6
|
import ValuesField from "./ValuesField";
|
|
7
7
|
import ConditionalFieldForm from "./ConditionalFieldForm";
|
|
8
8
|
import MandatoryConditional from "./MandatoryConditional";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { ActiveGroupForm } from "../ActiveGroupForm";
|
|
3
4
|
|
|
4
5
|
describe("<ActiveGroupForm />", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { DefaultValue } from "../DefaultValue";
|
|
4
5
|
|
|
5
6
|
describe("<DefaultValue />", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { waitFor } from "@testing-library/react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
|
-
import { render } from "@truedat/test/
|
|
3
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
4
4
|
import { DependentDomain } from "../DependentDomain";
|
|
5
5
|
|
|
6
6
|
describe("<DependentDomain />", () => {
|
|
@@ -62,7 +62,7 @@ describe("<DependentDomain />", () => {
|
|
|
62
62
|
it("calls onChange when whe select a domain", async () => {
|
|
63
63
|
const { findByRole } = render(<DependentDomain {...props} />, renderOpts);
|
|
64
64
|
|
|
65
|
-
userEvent.click(await findByRole("option", { name: /d2/ }));
|
|
65
|
+
await userEvent.click(await findByRole("option", { name: /d2/ }));
|
|
66
66
|
await waitFor(() => {
|
|
67
67
|
expect(onChange).toHaveBeenCalledWith({ ...values, 2: [] });
|
|
68
68
|
});
|
|
@@ -72,7 +72,7 @@ describe("<DependentDomain />", () => {
|
|
|
72
72
|
onChange.mockClear();
|
|
73
73
|
const { container } = render(<DependentDomain {...props} />, renderOpts);
|
|
74
74
|
|
|
75
|
-
userEvent.click(
|
|
75
|
+
await userEvent.click(
|
|
76
76
|
container.querySelectorAll('[class="remove circle link icon"]')[0],
|
|
77
77
|
);
|
|
78
78
|
await waitFor(() => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// FieldDefinition.realDefs.test.tsx
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { render
|
|
3
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
4
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
4
5
|
import { within } from "@testing-library/react";
|
|
5
6
|
import userEvent from "@testing-library/user-event";
|
|
6
7
|
import FieldDefinition from "../FieldDefinition";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { FieldForm } from "../FieldForm";
|
|
4
5
|
|
|
5
6
|
describe("<FieldForm />", () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
2
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
2
3
|
import { GroupsList } from "../GroupsList";
|
|
3
4
|
|
|
4
5
|
describe("<GroupsList />", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { waitFor } from "@testing-library/react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
|
-
import { render } from "@truedat/test/
|
|
3
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
4
4
|
import { MandatoryConditional } from "../MandatoryConditional";
|
|
5
5
|
|
|
6
6
|
describe("<MandatoryConditional />", () => {
|
|
@@ -65,7 +65,7 @@ describe("<MandatoryConditional />", () => {
|
|
|
65
65
|
renderOpts,
|
|
66
66
|
);
|
|
67
67
|
|
|
68
|
-
userEvent.click(await findByRole("option", { name: /Foo/ }));
|
|
68
|
+
await userEvent.click(await findByRole("option", { name: /Foo/ }));
|
|
69
69
|
await waitFor(() => {
|
|
70
70
|
expect(onChange.mock.calls[0][1]).toEqual({
|
|
71
71
|
name: `${fieldNamePrefix}.mandatory.to_be`,
|
|
@@ -85,7 +85,7 @@ describe("<MandatoryConditional />", () => {
|
|
|
85
85
|
renderOpts,
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
userEvent.click(await findByRole("option", { name: /4/ }));
|
|
88
|
+
await userEvent.click(await findByRole("option", { name: /4/ }));
|
|
89
89
|
await waitFor(() => {
|
|
90
90
|
expect(onChange.mock.calls[0][1]).toEqual({
|
|
91
91
|
name: `${fieldNamePrefix}.mandatory.to_be`,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import SwitchListForm from "../SwitchListForm";
|
|
4
5
|
|
|
5
6
|
describe("<SwitchListForm />", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import { SwitchSegment } from "../SwitchSegment";
|
|
4
5
|
|
|
5
6
|
describe("<SwitchSegment />", () => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { within } from "@testing-library/react";
|
|
3
|
-
import { render
|
|
3
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
4
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
4
5
|
import userEvent from "@testing-library/user-event";
|
|
5
6
|
import TableValuesForm from "../TableValuesForm";
|
|
6
7
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
3
|
import { waitFor } from "@testing-library/react";
|
|
4
|
-
import { render
|
|
4
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
5
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
5
6
|
import TemplateRelationsForm from "../TemplateRelationsForm";
|
|
6
7
|
|
|
7
8
|
jest.mock("@truedat/dd/hooks/useSystems", () => ({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
2
|
import { within } from "@testing-library/react";
|
|
3
|
-
import { render
|
|
3
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
4
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
4
5
|
import ValuesListForm from "../ValuesListForm";
|
|
5
6
|
|
|
6
7
|
describe("<ValuesListForm /> fixed", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
-
import { render
|
|
2
|
+
import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
|
|
3
|
+
import { waitForLoad } from "@truedat/test/waitForLoad";
|
|
3
4
|
import ValuesSelector from "../ValuesSelector";
|
|
4
5
|
|
|
5
6
|
describe("<ValuesSelector />", () => {
|