@truedat/bg 7.5.9 → 7.5.11
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 +41 -70
- package/src/concepts/components/Concept.js +22 -19
- package/src/concepts/components/ConceptActions.js +39 -34
- package/src/concepts/components/ConceptArchive.js +0 -1
- package/src/concepts/components/ConceptArchiveRow.js +3 -4
- package/src/concepts/components/ConceptCompleteness.js +1 -2
- package/src/concepts/components/ConceptConfidentialButton.js +1 -2
- package/src/concepts/components/ConceptCreate.js +1 -1
- package/src/concepts/components/ConceptCrumbs.js +10 -8
- package/src/concepts/components/ConceptDeleteModalBody.js +7 -10
- package/src/concepts/components/ConceptDetails.js +3 -3
- package/src/concepts/components/ConceptEdit.js +5 -5
- package/src/concepts/components/ConceptForm.js +39 -43
- package/src/concepts/components/ConceptHeader.js +0 -1
- package/src/concepts/components/ConceptLinksDropdownSelector.js +1 -2
- package/src/concepts/components/ConceptLoader.js +3 -3
- package/src/concepts/components/ConceptManageDomain.js +2 -1
- package/src/concepts/components/ConceptManageDomainPopup.js +1 -1
- package/src/concepts/components/ConceptRoutes.js +263 -226
- package/src/concepts/components/ConceptRow.js +0 -1
- package/src/concepts/components/ConceptSubscription.js +15 -14
- package/src/concepts/components/ConceptSummary.js +0 -1
- package/src/concepts/components/ConceptTabPane.js +36 -41
- package/src/concepts/components/ConceptTabs.js +1 -4
- package/src/concepts/components/ConceptTaxonomy.js +1 -3
- package/src/concepts/components/Concepts.js +0 -1
- package/src/concepts/components/ConceptsActions.js +2 -3
- package/src/concepts/components/ConceptsBulkUpdate.js +3 -6
- package/src/concepts/components/ConceptsLabelResults.js +0 -1
- package/src/concepts/components/ConceptsLinkDecorator.js +1 -2
- package/src/concepts/components/ConceptsLinksManagement.js +7 -8
- package/src/concepts/components/ConceptsPagination.js +0 -1
- package/src/concepts/components/ConceptsPanel.js +5 -4
- package/src/concepts/components/ConceptsTable.js +2 -3
- package/src/concepts/components/ConceptsUpdateButton.js +6 -6
- package/src/concepts/components/ConceptsUploadButton.js +0 -1
- package/src/concepts/components/ConceptsUploadEvents.js +0 -2
- package/src/concepts/components/ConceptsUploadEventsTable.js +12 -19
- package/src/concepts/components/DomainConcepts.js +0 -1
- package/src/concepts/components/EventRow.js +0 -1
- package/src/concepts/components/Events.js +3 -4
- package/src/concepts/components/FieldGroupTable.js +1 -2
- package/src/concepts/components/LinkedMessage.js +9 -13
- package/src/concepts/components/SharedToDomains.js +8 -7
- package/src/concepts/components/SharedToDomainsPopup.js +1 -1
- package/src/concepts/components/SharedToForm.js +3 -6
- package/src/concepts/components/__tests__/Concept.spec.js +8 -42
- package/src/concepts/components/__tests__/ConceptActions.spec.js +7 -7
- package/src/concepts/components/__tests__/ConceptArchive.spec.js +5 -5
- package/src/concepts/components/__tests__/ConceptArchiveLoader.spec.js +15 -14
- package/src/concepts/components/__tests__/ConceptArchiveRow.spec.js +0 -1
- package/src/concepts/components/__tests__/ConceptCompleteness.spec.js +0 -1
- package/src/concepts/components/__tests__/ConceptConfidentialButton.spec.js +10 -17
- package/src/concepts/components/__tests__/ConceptContext.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptCrumbs.spec.js +12 -34
- package/src/concepts/components/__tests__/ConceptDeleteModalBody.spec.js +47 -26
- package/src/concepts/components/__tests__/ConceptDetails.spec.js +1 -9
- package/src/concepts/components/__tests__/ConceptEdit.spec.js +2 -2
- package/src/concepts/components/__tests__/ConceptForm.spec.js +26 -19
- package/src/concepts/components/__tests__/ConceptHeader.spec.js +33 -57
- package/src/concepts/components/__tests__/ConceptLinksManagement.spec.js +27 -34
- package/src/concepts/components/__tests__/ConceptLoader.spec.js +51 -37
- package/src/concepts/components/__tests__/ConceptManageDomain.spec.js +12 -47
- package/src/concepts/components/__tests__/ConceptManageDomainPopup.spec.js +65 -24
- package/src/concepts/components/__tests__/ConceptRow.spec.js +6 -17
- package/src/concepts/components/__tests__/ConceptSubscription.spec.js +9 -9
- package/src/concepts/components/__tests__/ConceptSubscriptionLoader.spec.js +20 -16
- package/src/concepts/components/__tests__/ConceptSummary.spec.js +11 -10
- package/src/concepts/components/__tests__/ConceptTabPane.spec.js +73 -5
- package/src/concepts/components/__tests__/ConceptTabs.spec.js +6 -21
- package/src/concepts/components/__tests__/ConceptTaxonomy.spec.js +16 -12
- package/src/concepts/components/__tests__/Concepts.spec.js +6 -26
- package/src/concepts/components/__tests__/ConceptsActions.spec.js +0 -1
- package/src/concepts/components/__tests__/ConceptsBulkUpdate.spec.js +31 -36
- package/src/concepts/components/__tests__/ConceptsLabelResults.spec.js +4 -5
- package/src/concepts/components/__tests__/ConceptsLinkDecorator.spec.js +3 -4
- package/src/concepts/components/__tests__/ConceptsPanel.spec.js +7 -26
- package/src/concepts/components/__tests__/ConceptsTable.spec.js +34 -60
- package/src/concepts/components/__tests__/ConceptsUpdateButton.spec.js +6 -7
- package/src/concepts/components/__tests__/ConceptsUploadButton.spec.js +25 -13
- package/src/concepts/components/__tests__/ConceptsUploadEventsTable.spec.js +11 -9
- package/src/concepts/components/__tests__/Events.spec.js +10 -10
- package/src/concepts/components/__tests__/SharedToDomains.spec.js +25 -19
- package/src/concepts/components/__tests__/SharedToDomainsPopup.spec.js +48 -36
- package/src/concepts/components/__tests__/SharedToForm.spec.js +24 -32
- package/src/concepts/components/__tests__/__snapshots__/Concept.spec.js.snap +108 -23
- package/src/concepts/components/__tests__/__snapshots__/ConceptActions.spec.js.snap +12 -16
- package/src/concepts/components/__tests__/__snapshots__/ConceptArchive.spec.js.snap +77 -65
- package/src/concepts/components/__tests__/__snapshots__/ConceptArchiveRow.spec.js.snap +2 -4
- package/src/concepts/components/__tests__/__snapshots__/ConceptConfidentialButton.spec.js.snap +11 -31
- package/src/concepts/components/__tests__/__snapshots__/ConceptCrumbs.spec.js.snap +41 -56
- package/src/concepts/components/__tests__/__snapshots__/ConceptDeleteModalBody.spec.js.snap +3 -5
- package/src/concepts/components/__tests__/__snapshots__/ConceptDetails.spec.js.snap +0 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptEdit.spec.js.snap +1 -12
- package/src/concepts/components/__tests__/__snapshots__/ConceptForm.spec.js.snap +10 -11
- package/src/concepts/components/__tests__/__snapshots__/ConceptHeader.spec.js.snap +2 -2
- package/src/concepts/components/__tests__/__snapshots__/ConceptLinksManagement.spec.js.snap +14 -14
- package/src/concepts/components/__tests__/__snapshots__/ConceptLoader.spec.js.snap +14 -9
- package/src/concepts/components/__tests__/__snapshots__/ConceptManageDomain.spec.js.snap +43 -5
- package/src/concepts/components/__tests__/__snapshots__/ConceptManageDomainPopup.spec.js.snap +10 -163
- package/src/concepts/components/__tests__/__snapshots__/ConceptRow.spec.js.snap +4 -7
- package/src/concepts/components/__tests__/__snapshots__/ConceptSubscription.spec.js.snap +8 -55
- package/src/concepts/components/__tests__/__snapshots__/ConceptSubscriptionLoader.spec.js.snap +1 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptSummary.spec.js.snap +6 -6
- package/src/concepts/components/__tests__/__snapshots__/ConceptTabPane.spec.js.snap +18 -34
- package/src/concepts/components/__tests__/__snapshots__/ConceptTabs.spec.js.snap +26 -13
- package/src/concepts/components/__tests__/__snapshots__/ConceptTaxonomy.spec.js.snap +63 -53
- package/src/concepts/components/__tests__/__snapshots__/Concepts.spec.js.snap +10 -25
- package/src/concepts/components/__tests__/__snapshots__/ConceptsActions.spec.js.snap +1 -0
- package/src/concepts/components/__tests__/__snapshots__/ConceptsBulkUpdate.spec.js.snap +7 -6
- package/src/concepts/components/__tests__/__snapshots__/ConceptsLabelResults.spec.js.snap +1 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptsLinkDecorator.spec.js.snap +1 -0
- package/src/concepts/components/__tests__/__snapshots__/ConceptsPanel.spec.js.snap +10 -25
- package/src/concepts/components/__tests__/__snapshots__/ConceptsTable.spec.js.snap +1 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptsUpdateButton.spec.js.snap +1 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptsUploadButton.spec.js.snap +9 -74
- package/src/concepts/components/__tests__/__snapshots__/ConceptsUploadEventsTable.spec.js.snap +14 -14
- package/src/concepts/components/__tests__/__snapshots__/Events.spec.js.snap +83 -43
- package/src/concepts/components/__tests__/__snapshots__/SharedToDomains.spec.js.snap +56 -33
- package/src/concepts/components/__tests__/__snapshots__/SharedToDomainsPopup.spec.js.snap +9 -145
- package/src/concepts/components/__tests__/__snapshots__/SharedToForm.spec.js.snap +2 -2
- package/src/concepts/reducers/__tests__/conceptRedirect.spec.js +1 -1
- package/src/concepts/reducers/conceptRedirect.js +4 -6
- package/src/concepts/relations/components/ConceptImplementationLinks.js +5 -4
- package/src/concepts/relations/components/ConceptLinkActions.js +1 -1
- package/src/concepts/relations/components/ConceptLinksActions.js +4 -4
- package/src/concepts/relations/components/ConceptRelationActions.js +3 -4
- package/src/concepts/relations/components/ConceptRelationForm.js +3 -3
- package/src/concepts/relations/components/ConceptRelationRow.js +10 -10
- package/src/concepts/relations/components/ConceptRelations.js +10 -11
- package/src/concepts/relations/components/ConceptRelationsRoutes.js +20 -39
- package/src/concepts/relations/components/ConceptRelationsSummary.js +26 -29
- package/src/concepts/relations/components/ConceptSelector.js +4 -7
- package/src/concepts/relations/components/ConceptStructureLinks.js +2 -2
- package/src/concepts/relations/components/__tests__/ConceptImplementationLinks.spec.js +19 -59
- package/src/concepts/relations/components/__tests__/ConceptLinksActions.spec.js +9 -10
- package/src/concepts/relations/components/__tests__/ConceptRelationActions.spec.js +9 -7
- package/src/concepts/relations/components/__tests__/ConceptRelationForm.spec.js +30 -42
- package/src/concepts/relations/components/__tests__/ConceptRelationRow.spec.js +11 -16
- package/src/concepts/relations/components/__tests__/ConceptRelations.spec.js +11 -14
- package/src/concepts/relations/components/__tests__/ConceptRelationsRoutes.spec.js +108 -8
- package/src/concepts/relations/components/__tests__/ConceptRelationsSummary.spec.js +39 -38
- package/src/concepts/relations/components/__tests__/ConceptSelector.spec.js +24 -36
- package/src/concepts/relations/components/__tests__/ConceptStructureLinks.spec.js +21 -11
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptImplementationLinks.spec.js.snap +131 -28
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptLinksActions.spec.js.snap +4 -3
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptRelationActions.spec.js.snap +10 -26
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptRelationForm.spec.js.snap +15 -19
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptRelationRow.spec.js.snap +36 -33
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptRelations.spec.js.snap +76 -51
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptRelationsRoutes.spec.js.snap +15 -29
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptRelationsSummary.spec.js.snap +45 -100
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptSelector.spec.js.snap +9 -9
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptStructureLinks.spec.js.snap +10 -10
- package/src/concepts/relations/sagas/conceptLinkAction.js +2 -2
- package/src/concepts/relations/sagas/linkConcept.js +1 -1
- package/src/concepts/relations/selectors/getBusinessConceptsLinksToImplementationsColumns.js +1 -2
- package/src/concepts/relations/selectors/getConceptLinks.js +1 -2
- package/src/concepts/relations/selectors/getConceptRelations.js +14 -14
- package/src/concepts/sagas/__tests__/saveSharedTo.spec.js +3 -3
- package/src/concepts/sagas/__tests__/setConfidentialConcept.spec.js +5 -5
- package/src/concepts/sagas/conceptAction.js +2 -2
- package/src/concepts/sagas/fetchConceptArchive.js +1 -1
- package/src/concepts/sagas/setConfidentialConcept.js +2 -2
- package/src/concepts/selectors/__tests__/getConceptDomainPath.spec.js +2 -2
- package/src/concepts/selectors/getConceptColumns.js +1 -2
- package/src/concepts/selectors/getConceptTemplate.js +1 -1
- package/src/concepts/selectors/getConceptUploadEventColumns.js +0 -1
- package/src/concepts/selectors/getConceptVersionPath.js +2 -2
- package/src/concepts/selectors/getParsedEvents.js +2 -2
- package/src/concepts/selectors/getTemplateFields.js +3 -3
- package/src/concepts/selectors/getTemplateGroups.js +1 -1
- package/src/hooks/__mocks__/useDomains.js +42 -0
- package/src/hooks/useDomains.js +3 -3
- package/src/taxonomy/components/AddDomainMember.js +3 -4
- package/src/taxonomy/components/Domain.js +19 -23
- package/src/taxonomy/components/DomainActions.js +1 -2
- package/src/taxonomy/components/DomainCards.js +4 -6
- package/src/taxonomy/components/DomainContent.js +42 -87
- package/src/taxonomy/components/DomainCrumbs.js +4 -4
- package/src/taxonomy/components/DomainDetail.js +4 -5
- package/src/taxonomy/components/DomainForm.js +1 -3
- package/src/taxonomy/components/DomainImplementations.js +8 -7
- package/src/taxonomy/components/DomainItem.js +1 -2
- package/src/taxonomy/components/DomainMembers.js +0 -1
- package/src/taxonomy/components/DomainRoutes.js +15 -21
- package/src/taxonomy/components/DomainSearch.js +0 -1
- package/src/taxonomy/components/DomainStructures.js +0 -1
- package/src/taxonomy/components/DomainTabs.js +3 -4
- package/src/taxonomy/components/DomainTaxonomy.js +1 -2
- package/src/taxonomy/components/Domains.js +15 -5
- package/src/taxonomy/components/DomainsActions.js +2 -4
- package/src/taxonomy/components/EditDomain.js +5 -5
- package/src/taxonomy/components/NewDomain.js +4 -4
- package/src/taxonomy/components/__tests__/AddDomainMember.spec.js +6 -5
- package/src/taxonomy/components/__tests__/Domain.spec.js +63 -123
- package/src/taxonomy/components/__tests__/DomainActions.spec.js +0 -1
- package/src/taxonomy/components/__tests__/DomainCards.spec.js +44 -51
- package/src/taxonomy/components/__tests__/DomainContent.spec.js +138 -158
- package/src/taxonomy/components/__tests__/DomainCrumbs.spec.js +14 -19
- package/src/taxonomy/components/__tests__/DomainDetail.spec.js +2 -3
- package/src/taxonomy/components/__tests__/DomainForm.spec.js +44 -60
- package/src/taxonomy/components/__tests__/DomainItem.spec.js +17 -14
- package/src/taxonomy/components/__tests__/DomainMembers.spec.js +9 -13
- package/src/taxonomy/components/__tests__/DomainRoutes.spec.js +54 -0
- package/src/taxonomy/components/__tests__/DomainStructures.spec.js +10 -51
- package/src/taxonomy/components/__tests__/DomainTabs.spec.js +14 -33
- package/src/taxonomy/components/__tests__/DomainTaxonomy.spec.js +17 -16
- package/src/taxonomy/components/__tests__/Domains.spec.js +63 -95
- package/src/taxonomy/components/__tests__/DomainsActions.spec.js +12 -11
- package/src/taxonomy/components/__tests__/EditDomain.spec.js +13 -54
- package/src/taxonomy/components/__tests__/NewDomain.spec.js +17 -61
- package/src/taxonomy/components/__tests__/__snapshots__/AddDomainMember.spec.js.snap +10 -9
- package/src/taxonomy/components/__tests__/__snapshots__/Domain.spec.js.snap +53 -72
- package/src/taxonomy/components/__tests__/__snapshots__/DomainActions.spec.js.snap +2 -1
- package/src/taxonomy/components/__tests__/__snapshots__/DomainCards.spec.js.snap +247 -27
- package/src/taxonomy/components/__tests__/__snapshots__/DomainContent.spec.js.snap +14 -294
- package/src/taxonomy/components/__tests__/__snapshots__/DomainCrumbs.spec.js.snap +6 -2
- package/src/taxonomy/components/__tests__/__snapshots__/DomainDetail.spec.js.snap +5 -4
- package/src/taxonomy/components/__tests__/__snapshots__/DomainForm.spec.js.snap +13 -12
- package/src/taxonomy/components/__tests__/__snapshots__/DomainItem.spec.js.snap +16 -12
- package/src/taxonomy/components/__tests__/__snapshots__/DomainRoutes.spec.js.snap +52 -0
- package/src/taxonomy/components/__tests__/__snapshots__/DomainStructures.spec.js.snap +7 -7
- package/src/taxonomy/components/__tests__/__snapshots__/DomainTabs.spec.js.snap +10 -5
- package/src/taxonomy/components/__tests__/__snapshots__/DomainTaxonomy.spec.js.snap +37 -29
- package/src/taxonomy/components/__tests__/__snapshots__/Domains.spec.js.snap +123 -6
- package/src/taxonomy/components/__tests__/__snapshots__/DomainsActions.spec.js.snap +2 -1
- package/src/taxonomy/components/__tests__/__snapshots__/EditDomain.spec.js.snap +15 -14
- package/src/taxonomy/components/__tests__/__snapshots__/NewDomain.spec.js.snap +31 -28
- package/src/taxonomy/selectors/index.js +0 -1
- package/src/concepts/relations/components/__tests__/ConceptSelector2.spec.js +0 -76
- package/src/concepts/selectors/__tests__/getConceptSubscope.spec.js +0 -37
- package/src/concepts/selectors/__tests__/getSidemenuGlossarySubscopes.spec.js +0 -17
- package/src/concepts/selectors/getConceptStatus.js +0 -1
- package/src/concepts/selectors/getConceptSubscope.js +0 -19
- package/src/concepts/selectors/getSidemenuGlossarySubscopes.js +0 -8
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
3
|
-
import { waitFor } from "@testing-library/react";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
2
|
import { LangProviderWrapper } from "@truedat/core/i18n";
|
|
5
3
|
import { Concept } from "../Concept";
|
|
6
4
|
import ConceptContextProvider, { useConceptContext } from "../ConceptContext";
|
|
@@ -29,33 +27,7 @@ jest.mock("@truedat/core/hooks", () => {
|
|
|
29
27
|
};
|
|
30
28
|
});
|
|
31
29
|
|
|
32
|
-
beforeAll(() => {
|
|
33
|
-
jest.useFakeTimers();
|
|
34
|
-
jest.setSystemTime(new Date("2025-01-01T10:00:00Z"));
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
afterAll(() => {
|
|
38
|
-
jest.useRealTimers();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
30
|
const renderOpts = {
|
|
42
|
-
messages: {
|
|
43
|
-
en: {
|
|
44
|
-
"concepts.crumbs.top": "Business Glossary",
|
|
45
|
-
"concepts.crumbs.pending": "Draft",
|
|
46
|
-
"i18n.messages.lang.es": "Spanish",
|
|
47
|
-
"i18n.messages.lang.en": "English",
|
|
48
|
-
"tabs.bg.concept": "Concept",
|
|
49
|
-
"tabs.bg.relations_data_field": "Linkage",
|
|
50
|
-
"tabs.bg.qualityRules": "Quality Rules",
|
|
51
|
-
"tabs.bg.history": "History",
|
|
52
|
-
"tabs.bg.audit": "Audit",
|
|
53
|
-
"concept.props.status": "Status",
|
|
54
|
-
"concept.props.version": "Version",
|
|
55
|
-
"concept.props.last_update_at": "Update",
|
|
56
|
-
"concept.props.last_update_by": "User",
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
31
|
state: {
|
|
60
32
|
concept: {
|
|
61
33
|
id: 1,
|
|
@@ -97,7 +69,6 @@ const renderOpts = {
|
|
|
97
69
|
{ id: 2, lang: "es", is_default: false, is_required: false },
|
|
98
70
|
],
|
|
99
71
|
},
|
|
100
|
-
fallback: "lazy",
|
|
101
72
|
};
|
|
102
73
|
|
|
103
74
|
describe("<Concept />", () => {
|
|
@@ -144,7 +115,8 @@ describe("<Concept />", () => {
|
|
|
144
115
|
useConceptContext.mockReturnValue({
|
|
145
116
|
conceptContext: { grantView: false },
|
|
146
117
|
});
|
|
147
|
-
|
|
118
|
+
|
|
119
|
+
const rendered = render(
|
|
148
120
|
<LangProviderWrapper langs={["es", "en"]}>
|
|
149
121
|
<ConceptContextProvider>
|
|
150
122
|
<Concept {...props} />
|
|
@@ -152,18 +124,15 @@ describe("<Concept />", () => {
|
|
|
152
124
|
</LangProviderWrapper>,
|
|
153
125
|
renderOpts
|
|
154
126
|
);
|
|
155
|
-
await
|
|
156
|
-
|
|
157
|
-
expect(container.querySelector(".loading")).not.toBeInTheDocument();
|
|
158
|
-
});
|
|
159
|
-
expect(container).toMatchSnapshot();
|
|
127
|
+
await waitForLoad(rendered);
|
|
128
|
+
expect(rendered.container).toMatchSnapshot();
|
|
160
129
|
});
|
|
161
130
|
|
|
162
131
|
it("matches the latest snapshot with grantView activated", async () => {
|
|
163
132
|
useConceptContext.mockReturnValue({
|
|
164
133
|
conceptContext: { grantView: true },
|
|
165
134
|
});
|
|
166
|
-
const
|
|
135
|
+
const rendered = render(
|
|
167
136
|
<LangProviderWrapper langs={["es", "en"]}>
|
|
168
137
|
<ConceptContextProvider>
|
|
169
138
|
<Concept {...props} />
|
|
@@ -171,10 +140,7 @@ describe("<Concept />", () => {
|
|
|
171
140
|
</LangProviderWrapper>,
|
|
172
141
|
renderOpts
|
|
173
142
|
);
|
|
174
|
-
await
|
|
175
|
-
|
|
176
|
-
expect(container.querySelector(".loading")).not.toBeInTheDocument();
|
|
177
|
-
});
|
|
178
|
-
expect(container).toMatchSnapshot();
|
|
143
|
+
await waitForLoad(rendered);
|
|
144
|
+
expect(rendered.container).toMatchSnapshot();
|
|
179
145
|
});
|
|
180
146
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { ConceptActions } from "../ConceptActions";
|
|
4
3
|
|
|
5
4
|
describe("<ConceptActions />", () => {
|
|
6
5
|
const conceptAction = jest.fn();
|
|
7
6
|
const conceptActions = {
|
|
8
7
|
action1: { method: "POST", href: "/api/action1" },
|
|
9
|
-
action2: { method: "GET", href: "/api/action2" }
|
|
8
|
+
action2: { method: "GET", href: "/api/action2" },
|
|
10
9
|
};
|
|
11
10
|
|
|
12
11
|
const props = {
|
|
13
12
|
conceptAction,
|
|
14
|
-
conceptActions
|
|
13
|
+
conceptActions,
|
|
15
14
|
};
|
|
16
15
|
|
|
17
|
-
it("matches the latest snapshot", () => {
|
|
18
|
-
const
|
|
19
|
-
|
|
16
|
+
it("matches the latest snapshot", async () => {
|
|
17
|
+
const rendered = render(<ConceptActions {...props} />);
|
|
18
|
+
await waitForLoad(rendered);
|
|
19
|
+
expect(rendered.container).toMatchSnapshot();
|
|
20
20
|
});
|
|
21
21
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { ConceptArchive } from "../ConceptArchive";
|
|
4
3
|
|
|
5
4
|
describe("<ConceptArchive />", () => {
|
|
6
|
-
it("matches the latest snapshot", () => {
|
|
5
|
+
it("matches the latest snapshot", async () => {
|
|
7
6
|
const conceptArchive = [
|
|
8
7
|
{
|
|
9
8
|
id: 123,
|
|
@@ -14,7 +13,8 @@ describe("<ConceptArchive />", () => {
|
|
|
14
13
|
},
|
|
15
14
|
];
|
|
16
15
|
const props = { conceptArchive };
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
const rendered = render(<ConceptArchive {...props} />);
|
|
17
|
+
await waitForLoad(rendered);
|
|
18
|
+
expect(rendered.container).toMatchSnapshot();
|
|
19
19
|
});
|
|
20
20
|
});
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { mount } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { ConceptArchiveLoader } from "../ConceptArchiveLoader";
|
|
4
3
|
|
|
5
4
|
describe("<ConceptArchiveLoader />", () => {
|
|
6
|
-
it("calls fetchConceptArchive when component mounts but not when it unmounts", () => {
|
|
5
|
+
it("calls fetchConceptArchive when component mounts but not when it unmounts", async () => {
|
|
7
6
|
const props = {
|
|
8
7
|
clearConceptArchive: jest.fn(),
|
|
9
8
|
fetchConceptArchive: jest.fn(),
|
|
10
|
-
id: 1
|
|
9
|
+
id: 1,
|
|
11
10
|
};
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const rendered = render(<ConceptArchiveLoader {...props} />);
|
|
12
|
+
await waitForLoad(rendered);
|
|
13
|
+
expect(props.fetchConceptArchive).toHaveBeenCalledTimes(1);
|
|
14
|
+
rendered.unmount();
|
|
15
|
+
expect(props.fetchConceptArchive).toHaveBeenCalledTimes(1);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it("calls clearConceptArchive when component unmounts but not when it mounts", () => {
|
|
18
|
+
it("calls clearConceptArchive when component unmounts but not when it mounts", async () => {
|
|
19
19
|
const props = {
|
|
20
20
|
clearConceptArchive: jest.fn(),
|
|
21
21
|
fetchConceptArchive: jest.fn(),
|
|
22
|
-
id: 1
|
|
22
|
+
id: 1,
|
|
23
23
|
};
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const rendered = render(<ConceptArchiveLoader {...props} />);
|
|
25
|
+
await waitForLoad(rendered);
|
|
26
|
+
expect(props.clearConceptArchive).toHaveBeenCalledTimes(0);
|
|
27
|
+
rendered.unmount();
|
|
28
|
+
expect(props.clearConceptArchive).toHaveBeenCalledTimes(1);
|
|
28
29
|
});
|
|
29
30
|
});
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { intl } from "@truedat/test/intl-stub";
|
|
3
|
-
import { shallow } from "enzyme";
|
|
4
|
-
import { shallowWithIntl } from "@truedat/test/intl-stub";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
2
|
import { ConceptConfidentialButton } from "../ConceptConfidentialButton";
|
|
6
3
|
|
|
7
|
-
// workaround for enzyme issue with React.useContext
|
|
8
|
-
// see https://github.com/airbnb/enzyme/issues/2176#issuecomment-532361526
|
|
9
|
-
jest.spyOn(React, "useContext").mockImplementation(() => intl);
|
|
10
|
-
|
|
11
4
|
describe("<ConceptConfidentialButton />", () => {
|
|
12
5
|
const setConfidentialConcept = jest.fn();
|
|
13
6
|
const props = {
|
|
14
7
|
concept: { id: 1, confidential: false },
|
|
15
8
|
conceptUpdating: false,
|
|
16
|
-
setConfidentialConcept: setConfidentialConcept
|
|
9
|
+
setConfidentialConcept: setConfidentialConcept,
|
|
17
10
|
};
|
|
18
11
|
|
|
19
|
-
it("matches the latest snapshot", () => {
|
|
20
|
-
const
|
|
21
|
-
|
|
12
|
+
it("matches the latest snapshot", async () => {
|
|
13
|
+
const rendered = render(<ConceptConfidentialButton {...props} />);
|
|
14
|
+
await waitForLoad(rendered);
|
|
15
|
+
expect(rendered.container).toMatchSnapshot();
|
|
22
16
|
});
|
|
23
17
|
|
|
24
|
-
it("Text is mark as confidential if concept is not confidential", () => {
|
|
25
|
-
const
|
|
18
|
+
it("Text is mark as confidential if concept is not confidential", async () => {
|
|
19
|
+
const rendered = render(<ConceptConfidentialButton {...props} />);
|
|
20
|
+
await waitForLoad(rendered);
|
|
26
21
|
|
|
27
|
-
expect(
|
|
28
|
-
"concept.mark_as_confidential"
|
|
29
|
-
);
|
|
22
|
+
expect(rendered.container.querySelector("i.lock.icon")).toBeInTheDocument();
|
|
30
23
|
});
|
|
31
24
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
import { render } from "@truedat/test/render";
|
|
3
|
-
import { renderHook, act } from "@testing-library/react
|
|
3
|
+
import { renderHook, act } from "@testing-library/react";
|
|
4
4
|
import ConceptContext, { useConceptContext } from "../ConceptContext";
|
|
5
5
|
|
|
6
6
|
describe("<ConceptContext />", () => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { render } from "@truedat/test/render";
|
|
4
3
|
import ConceptCrumbs from "../ConceptCrumbs";
|
|
5
4
|
|
|
@@ -18,8 +17,8 @@ describe("<ConceptCrumbs />", () => {
|
|
|
18
17
|
concept: {
|
|
19
18
|
name: "foo",
|
|
20
19
|
status: status,
|
|
21
|
-
business_concept_id: 123,
|
|
22
|
-
id: 456,
|
|
20
|
+
business_concept_id: "123",
|
|
21
|
+
id: "456",
|
|
23
22
|
i18n_content: {
|
|
24
23
|
es: {
|
|
25
24
|
name: "bar",
|
|
@@ -35,27 +34,6 @@ describe("<ConceptCrumbs />", () => {
|
|
|
35
34
|
});
|
|
36
35
|
})(statuses);
|
|
37
36
|
|
|
38
|
-
it(`matches the latest snapshot for locale`, async () => {
|
|
39
|
-
const renderOpts = {
|
|
40
|
-
locale: "es",
|
|
41
|
-
state: {
|
|
42
|
-
concept: {
|
|
43
|
-
name: "foo",
|
|
44
|
-
status: "deprecated",
|
|
45
|
-
business_concept_id: 123,
|
|
46
|
-
id: 456,
|
|
47
|
-
i18n_content: {
|
|
48
|
-
es: {
|
|
49
|
-
name: "bar",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
const { container } = render(<ConceptCrumbs />, renderOpts);
|
|
56
|
-
expect(container).toMatchSnapshot();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
37
|
it(`matches the latest snapshot for subscope`, async () => {
|
|
60
38
|
const renderOpts = {
|
|
61
39
|
state: {
|
|
@@ -63,8 +41,8 @@ describe("<ConceptCrumbs />", () => {
|
|
|
63
41
|
name: "foo",
|
|
64
42
|
status: "publised",
|
|
65
43
|
type: "someType",
|
|
66
|
-
business_concept_id: 123,
|
|
67
|
-
id: 456,
|
|
44
|
+
business_concept_id: "123",
|
|
45
|
+
id: "456",
|
|
68
46
|
},
|
|
69
47
|
sidemenuGlossarySubscopes: [],
|
|
70
48
|
allTemplates: [{ name: "someType", subscope: "someSubscope" }],
|
|
@@ -81,8 +59,8 @@ describe("<ConceptCrumbs />", () => {
|
|
|
81
59
|
name: "foo",
|
|
82
60
|
status: "publised",
|
|
83
61
|
type: "someType",
|
|
84
|
-
business_concept_id: 123,
|
|
85
|
-
id: 456,
|
|
62
|
+
business_concept_id: "123",
|
|
63
|
+
id: "456",
|
|
86
64
|
},
|
|
87
65
|
sidemenuGlossarySubscopes: ["someSubscope"],
|
|
88
66
|
allTemplates: [{ name: "someType", subscope: "someSubscope" }],
|
|
@@ -98,8 +76,8 @@ describe("<ConceptCrumbs />", () => {
|
|
|
98
76
|
concept: {
|
|
99
77
|
name: "foo",
|
|
100
78
|
status: "published",
|
|
101
|
-
business_concept_id: 123,
|
|
102
|
-
id: 456,
|
|
79
|
+
business_concept_id: "123",
|
|
80
|
+
id: "456",
|
|
103
81
|
},
|
|
104
82
|
},
|
|
105
83
|
};
|
|
@@ -117,8 +95,8 @@ describe("<ConceptCrumbs />", () => {
|
|
|
117
95
|
name: "foo",
|
|
118
96
|
status: "published",
|
|
119
97
|
type: "someType",
|
|
120
|
-
business_concept_id: 123,
|
|
121
|
-
id: 456,
|
|
98
|
+
business_concept_id: "123",
|
|
99
|
+
id: "456",
|
|
122
100
|
},
|
|
123
101
|
allTemplates: [{ name: "someType", subscope: "someSubscope" }],
|
|
124
102
|
},
|
|
@@ -137,8 +115,8 @@ describe("<ConceptCrumbs />", () => {
|
|
|
137
115
|
name: "foo",
|
|
138
116
|
status: "published",
|
|
139
117
|
type: "someType",
|
|
140
|
-
business_concept_id: 123,
|
|
141
|
-
id: 456,
|
|
118
|
+
business_concept_id: "123",
|
|
119
|
+
id: "456",
|
|
142
120
|
},
|
|
143
121
|
sidemenuGlossarySubscopes: ["someSubscope"],
|
|
144
122
|
allTemplates: [{ name: "someType", subscope: "someSubscope" }],
|
|
@@ -1,72 +1,93 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import ConceptDeleteModalBody from "../ConceptDeleteModalBody";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
2
|
+
import { ConceptDeleteModalBody } from "../ConceptDeleteModalBody";
|
|
4
3
|
|
|
5
4
|
describe("<ConceptDeleteModalBody />", () => {
|
|
6
|
-
it("contains default message with default props set to 0", () => {
|
|
5
|
+
it("contains default message with default props set to 0", async () => {
|
|
7
6
|
const props = {
|
|
8
7
|
linkCount: 0,
|
|
9
8
|
ruleCount: 0,
|
|
10
9
|
conceptCount: 0,
|
|
11
10
|
};
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const rendered = render(<ConceptDeleteModalBody {...props} />);
|
|
12
|
+
await waitForLoad(rendered);
|
|
13
|
+
expect(
|
|
14
|
+
rendered.getByText(/concepts.actions.delete.body.without_content/i)
|
|
15
|
+
).toBeInTheDocument();
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it("contains one
|
|
18
|
+
it("contains one list item with LinkCount props > 0", async () => {
|
|
19
19
|
const props = {
|
|
20
20
|
linkCount: 0,
|
|
21
21
|
ruleCount: 1,
|
|
22
22
|
conceptCount: 0,
|
|
23
23
|
};
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const rendered = render(<ConceptDeleteModalBody {...props} />);
|
|
25
|
+
await waitForLoad(rendered);
|
|
26
|
+
expect(
|
|
27
|
+
rendered.container.querySelectorAll(".concept_delete_modal_body__item")
|
|
28
|
+
.length
|
|
29
|
+
).toBe(1);
|
|
26
30
|
});
|
|
27
31
|
|
|
28
|
-
it("contains one
|
|
32
|
+
it("contains one list item with ruleCount props > 0", async () => {
|
|
29
33
|
const props = {
|
|
30
34
|
linkCount: 1,
|
|
31
35
|
ruleCount: 0,
|
|
32
36
|
conceptCount: 0,
|
|
33
37
|
};
|
|
34
|
-
const
|
|
35
|
-
|
|
38
|
+
const rendered = render(<ConceptDeleteModalBody {...props} />);
|
|
39
|
+
await waitForLoad(rendered);
|
|
40
|
+
expect(
|
|
41
|
+
rendered.container.querySelectorAll(".concept_delete_modal_body__item")
|
|
42
|
+
.length
|
|
43
|
+
).toBe(1);
|
|
36
44
|
});
|
|
37
45
|
|
|
38
|
-
it("contains one
|
|
46
|
+
it("contains one list item with conceptCount props > 0", async () => {
|
|
39
47
|
const props = {
|
|
40
48
|
linkCount: 0,
|
|
41
49
|
ruleCount: 0,
|
|
42
50
|
conceptCount: 1,
|
|
43
51
|
};
|
|
44
|
-
const
|
|
45
|
-
|
|
52
|
+
const rendered = render(<ConceptDeleteModalBody {...props} />);
|
|
53
|
+
await waitForLoad(rendered);
|
|
54
|
+
expect(
|
|
55
|
+
rendered.container.querySelectorAll(".concept_delete_modal_body__item")
|
|
56
|
+
.length
|
|
57
|
+
).toBe(1);
|
|
46
58
|
});
|
|
47
59
|
|
|
48
|
-
it("contains two
|
|
60
|
+
it("contains two list items with linkCount props > 0 and ruleCount > 0", async () => {
|
|
49
61
|
const props = {
|
|
50
62
|
linkCount: 3,
|
|
51
63
|
ruleCount: 2,
|
|
52
64
|
conceptCount: 0,
|
|
53
65
|
};
|
|
54
|
-
const
|
|
55
|
-
|
|
66
|
+
const rendered = render(<ConceptDeleteModalBody {...props} />);
|
|
67
|
+
await waitForLoad(rendered);
|
|
68
|
+
expect(
|
|
69
|
+
rendered.container.querySelectorAll(".concept_delete_modal_body__item")
|
|
70
|
+
.length
|
|
71
|
+
).toBe(2);
|
|
56
72
|
});
|
|
57
73
|
|
|
58
|
-
it("contains
|
|
74
|
+
it("contains three list items with linkCount props > 0 and ruleCount > 0 and conceptCount > 0", async () => {
|
|
59
75
|
const props = {
|
|
60
76
|
linkCount: 3,
|
|
61
77
|
ruleCount: 2,
|
|
62
78
|
conceptCount: 2,
|
|
63
79
|
};
|
|
64
|
-
const
|
|
65
|
-
|
|
80
|
+
const rendered = render(<ConceptDeleteModalBody {...props} />);
|
|
81
|
+
await waitForLoad(rendered);
|
|
82
|
+
expect(
|
|
83
|
+
rendered.container.querySelectorAll(".concept_delete_modal_body__item")
|
|
84
|
+
.length
|
|
85
|
+
).toBe(3);
|
|
66
86
|
});
|
|
67
87
|
|
|
68
|
-
it("matches the latest snapshot", () => {
|
|
69
|
-
const
|
|
70
|
-
|
|
88
|
+
it("matches the latest snapshot", async () => {
|
|
89
|
+
const rendered = render(<ConceptDeleteModalBody />);
|
|
90
|
+
await waitForLoad(rendered);
|
|
91
|
+
expect(rendered.container).toMatchSnapshot();
|
|
71
92
|
});
|
|
72
93
|
});
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { render } from "@truedat/test/render";
|
|
3
2
|
import { ConceptDetails } from "../ConceptDetails";
|
|
4
3
|
|
|
5
|
-
const renderOpts = {
|
|
6
|
-
fallback: "lazy",
|
|
7
|
-
};
|
|
8
|
-
|
|
9
4
|
describe("<ConceptDetails />", () => {
|
|
10
5
|
const props = {
|
|
11
6
|
concept: {
|
|
@@ -31,10 +26,7 @@ describe("<ConceptDetails />", () => {
|
|
|
31
26
|
};
|
|
32
27
|
|
|
33
28
|
it("matches the latest snapshot", async () => {
|
|
34
|
-
const { container, findByText } = render(
|
|
35
|
-
<ConceptDetails {...props} />,
|
|
36
|
-
renderOpts
|
|
37
|
-
);
|
|
29
|
+
const { container, findByText } = render(<ConceptDetails {...props} />);
|
|
38
30
|
|
|
39
31
|
await findByText("field_label");
|
|
40
32
|
expect(container).toMatchSnapshot();
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { act } from "react-dom/test-utils";
|
|
3
1
|
import { render } from "@truedat/test/render";
|
|
4
2
|
import { waitFor } from "@testing-library/react";
|
|
5
3
|
import { LangProviderWrapper } from "@truedat/core/i18n";
|
|
@@ -86,6 +84,8 @@ jest.mock("@truedat/bg/concepts/hooks/useConcepts", () => {
|
|
|
86
84
|
};
|
|
87
85
|
});
|
|
88
86
|
|
|
87
|
+
jest.mock("@truedat/ai/hooks/useSuggestions");
|
|
88
|
+
|
|
89
89
|
const concept = {
|
|
90
90
|
_actions: { can_create_structure_link: true },
|
|
91
91
|
id: 1,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React, { Suspense } from "react";
|
|
2
1
|
import { waitFor } from "@testing-library/react";
|
|
3
|
-
import { render } from "@truedat/test/render";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
3
|
import { domainsMock, multipleTemplatesMock } from "@truedat/test/mocks";
|
|
5
4
|
import ConceptForm from "../ConceptForm";
|
|
6
5
|
|
|
@@ -27,8 +26,27 @@ jest.mock("@truedat/ai/hooks/useSuggestions", () => {
|
|
|
27
26
|
|
|
28
27
|
jest.mock("@truedat/ai/hooks/useTranslations", () => ({
|
|
29
28
|
useAvailabilityCheck: jest.fn(() => ({
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
trigger: jest.fn(
|
|
30
|
+
() =>
|
|
31
|
+
new Promise(() => ({
|
|
32
|
+
data: {
|
|
33
|
+
data: {
|
|
34
|
+
status: "ok",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}))
|
|
38
|
+
),
|
|
39
|
+
})),
|
|
40
|
+
useRequestTranslation: jest.fn(() => ({
|
|
41
|
+
trigger: jest.fn(() =>
|
|
42
|
+
Promise.resolve({
|
|
43
|
+
data: {
|
|
44
|
+
data: {
|
|
45
|
+
es: {},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
),
|
|
32
50
|
})),
|
|
33
51
|
}));
|
|
34
52
|
|
|
@@ -49,9 +67,6 @@ const props = {
|
|
|
49
67
|
setAltLang: jest.fn(),
|
|
50
68
|
};
|
|
51
69
|
|
|
52
|
-
const state = {
|
|
53
|
-
// domains: [{ id: 1, name: "domain1" }],
|
|
54
|
-
};
|
|
55
70
|
const templateVariables = { scope: "bg", domainIds: [1] };
|
|
56
71
|
const domainVariables = { action: "createBusinessConcept" };
|
|
57
72
|
|
|
@@ -62,23 +77,15 @@ describe("<ConceptForm />", () => {
|
|
|
62
77
|
multipleTemplatesMock(templateVariables),
|
|
63
78
|
domainsMock(domainVariables),
|
|
64
79
|
],
|
|
65
|
-
state,
|
|
66
|
-
fallback: "lazy",
|
|
67
80
|
};
|
|
68
81
|
|
|
69
82
|
it("matches the latest snapshot", async () => {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
<ConceptForm {...props} />
|
|
73
|
-
</Suspense>,
|
|
74
|
-
renderOpts
|
|
75
|
-
);
|
|
76
|
-
await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
|
|
83
|
+
const rendered = render(<ConceptForm {...props} />, renderOpts);
|
|
84
|
+
await waitForLoad(rendered);
|
|
77
85
|
await waitFor(() =>
|
|
78
|
-
expect(queryByText(/
|
|
86
|
+
expect(rendered.queryByText(/bazdomain/i)).toBeInTheDocument()
|
|
79
87
|
);
|
|
80
|
-
|
|
81
|
-
expect(container).toMatchSnapshot();
|
|
88
|
+
expect(rendered.container).toMatchSnapshot();
|
|
82
89
|
});
|
|
83
90
|
});
|
|
84
91
|
});
|