@truedat/bg 7.5.8 → 7.5.10
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 +1 -2
- 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 +2 -2
- 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 +5 -5
- 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 +9 -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,7 +1,6 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Link } from "react-router
|
|
3
|
+
import { Link } from "react-router";
|
|
5
4
|
import { compose } from "redux";
|
|
6
5
|
import { connect } from "react-redux";
|
|
7
6
|
import { Header, List, Segment } from "semantic-ui-react";
|
|
@@ -22,30 +21,28 @@ const Bold = ({ children }) => (
|
|
|
22
21
|
<div className="concept-summary-bold">{children}</div>
|
|
23
22
|
);
|
|
24
23
|
|
|
25
|
-
const Tag = ({ tag }) =>
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
48
|
-
};
|
|
24
|
+
const Tag = ({ tag }) => (
|
|
25
|
+
<List.Item className="concept-summary">
|
|
26
|
+
<Bold>{tag.i18n}</Bold>
|
|
27
|
+
<List.List>
|
|
28
|
+
{tag.relations.map((relation, index) =>
|
|
29
|
+
relation.relationSide === "source" ? (
|
|
30
|
+
<Relation
|
|
31
|
+
key={`${relation.relationSide}.${relation.id}.${index}`}
|
|
32
|
+
id={getLinkId(relation, relation.relationSide)}
|
|
33
|
+
name={relation.context.target.name}
|
|
34
|
+
/>
|
|
35
|
+
) : (
|
|
36
|
+
<Relation
|
|
37
|
+
key={`${relation.relationSide}.${relation.id}.${index}`}
|
|
38
|
+
id={getLinkId(relation, relation.relationSide)}
|
|
39
|
+
name={relation.context.source.name}
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
)}
|
|
43
|
+
</List.List>
|
|
44
|
+
</List.Item>
|
|
45
|
+
);
|
|
49
46
|
|
|
50
47
|
const Relation = ({ id, name }) => (
|
|
51
48
|
<List.Item
|
|
@@ -72,9 +69,9 @@ export const ConceptRelationsSummary = ({ conceptRelations }) =>
|
|
|
72
69
|
<FormattedMessage id="concepts.relations" />
|
|
73
70
|
</Header>
|
|
74
71
|
<List>
|
|
75
|
-
{conceptRelations.map((tag) =>
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
{conceptRelations.map((tag) => (
|
|
73
|
+
<Tag key={`${tag.relationSide}.${tag.id}`} tag={tag} />
|
|
74
|
+
))}
|
|
78
75
|
</List>
|
|
79
76
|
</Segment>
|
|
80
77
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { connect } from "react-redux";
|
|
5
4
|
import {
|
|
@@ -58,12 +57,10 @@ const ConceptSelectorRow = ({
|
|
|
58
57
|
<Table.Cell
|
|
59
58
|
content={
|
|
60
59
|
<Label color={mapStatusColor[status]}>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/>
|
|
66
|
-
) || <Icon name="ellipsis vertical" color="grey" />}
|
|
60
|
+
<FormattedMessage
|
|
61
|
+
id={`concepts.status.${status}`}
|
|
62
|
+
defaultMessage={status}
|
|
63
|
+
/>
|
|
67
64
|
</Label>
|
|
68
65
|
}
|
|
69
66
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { lazy } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
5
|
import { Segment, Grid } from "semantic-ui-react";
|
|
@@ -17,7 +17,7 @@ import { getConceptLinks } from "../selectors";
|
|
|
17
17
|
import { useConceptContext } from "../../components/ConceptContext";
|
|
18
18
|
import ConceptLinksActions from "./ConceptLinksActions";
|
|
19
19
|
|
|
20
|
-
const LinksPane =
|
|
20
|
+
const LinksPane = lazy(() => import("@truedat/lm/components/LinksPane"));
|
|
21
21
|
|
|
22
22
|
const ConceptStructureLinksSegment = ({ groups, visible }) => {
|
|
23
23
|
const { conceptContext, setConceptContextProperty } = useConceptContext();
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
3
|
-
import { render } from "@truedat/test/render";
|
|
4
|
-
import en from "../../../../messages/en";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
3
|
import { ConceptImplementationLinks } from "../ConceptImplementationLinks";
|
|
6
4
|
import { getBusinessConceptsLinksToImplementationsColumns } from "../../selectors";
|
|
7
5
|
|
|
8
|
-
jest.mock("react-router
|
|
9
|
-
...jest.requireActual("react-router
|
|
6
|
+
jest.mock("react-router", () => ({
|
|
7
|
+
...jest.requireActual("react-router"),
|
|
10
8
|
useParams: () => ({
|
|
11
9
|
business_concept_id: "6483",
|
|
12
10
|
id: "12345",
|
|
@@ -15,27 +13,9 @@ jest.mock("react-router-dom", () => ({
|
|
|
15
13
|
|
|
16
14
|
const columns = getBusinessConceptsLinksToImplementationsColumns({});
|
|
17
15
|
|
|
18
|
-
const messages = {
|
|
19
|
-
en: {
|
|
20
|
-
...en,
|
|
21
|
-
"ruleImplementations.props.goal": "Goal",
|
|
22
|
-
"ruleImplementations.props.minimum": "Minimum",
|
|
23
|
-
"ruleImplementations.props.result_type": "Result Type",
|
|
24
|
-
"ruleImplementations.props.last_execution_at": "Last execution",
|
|
25
|
-
"ruleImplementations.props.status": "Status",
|
|
26
|
-
"ruleImplementations.props.rule": "Rule",
|
|
27
|
-
"ruleImplementations.props.implementation_key": "Implementation",
|
|
28
|
-
"ruleImplementations.props.result": "Result",
|
|
29
|
-
"ruleImplementations.props.updated_at": "Updated At",
|
|
30
|
-
"ruleImplementations.props.inserted_at": "Inserted At",
|
|
31
|
-
"implementations.actions.create": "Create Implementation",
|
|
32
|
-
"implementations.actions.create_raw": "Create Raw Implementation",
|
|
33
|
-
"concepts.implementations.empty": "This concept has no implementations",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
16
|
|
|
37
17
|
describe("<ConceptImplementationLinks />", () => {
|
|
38
|
-
it("matches the latest snapshot", () => {
|
|
18
|
+
it("matches the latest snapshot", async () => {
|
|
39
19
|
const props = {
|
|
40
20
|
groups: [
|
|
41
21
|
["group", [{ implementation_key: "foo", id: "1" }]],
|
|
@@ -43,18 +23,12 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
43
23
|
],
|
|
44
24
|
columns,
|
|
45
25
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<ConceptImplementationLinks {...props} />
|
|
50
|
-
</Suspense>,
|
|
51
|
-
renderOpts
|
|
52
|
-
);
|
|
53
|
-
expect(container).toMatchSnapshot();
|
|
26
|
+
const rendered = render(<ConceptImplementationLinks {...props} />);
|
|
27
|
+
await waitForLoad(rendered);
|
|
28
|
+
expect(rendered.container).toMatchSnapshot();
|
|
54
29
|
});
|
|
55
30
|
|
|
56
|
-
it("show create implementations buttons when have permissions", () => {
|
|
57
|
-
const renderOpts = { messages };
|
|
31
|
+
it("show create implementations buttons when have permissions", async () => {
|
|
58
32
|
const props = {
|
|
59
33
|
groups: [
|
|
60
34
|
["group", [{ implementation_key: "foo", id: "1" }]],
|
|
@@ -65,17 +39,12 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
65
39
|
createLinkImplementation: { method: "POST" },
|
|
66
40
|
createImplementation: { method: "POST" },
|
|
67
41
|
};
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
</Suspense>,
|
|
72
|
-
renderOpts
|
|
73
|
-
);
|
|
74
|
-
expect(container).toMatchSnapshot();
|
|
42
|
+
const rendered = render(<ConceptImplementationLinks {...props} />);
|
|
43
|
+
await waitForLoad(rendered);
|
|
44
|
+
expect(rendered.container).toMatchSnapshot();
|
|
75
45
|
});
|
|
76
46
|
|
|
77
|
-
it("show implementations with groups", () => {
|
|
78
|
-
const renderOpts = { messages };
|
|
47
|
+
it("show implementations with groups", async () => {
|
|
79
48
|
const props = {
|
|
80
49
|
groups: [
|
|
81
50
|
["○", [{ implementation_key: "foo", id: "1" }]],
|
|
@@ -86,17 +55,12 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
86
55
|
createLinkImplementation: { method: "POST" },
|
|
87
56
|
createImplementation: { method: "POST" },
|
|
88
57
|
};
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
</Suspense>,
|
|
93
|
-
renderOpts
|
|
94
|
-
);
|
|
95
|
-
expect(container).toMatchSnapshot();
|
|
58
|
+
const rendered = render(<ConceptImplementationLinks {...props} />);
|
|
59
|
+
await waitForLoad(rendered);
|
|
60
|
+
expect(rendered.container).toMatchSnapshot();
|
|
96
61
|
});
|
|
97
62
|
|
|
98
|
-
it("when don't have any implementation", () => {
|
|
99
|
-
const renderOpts = { messages };
|
|
63
|
+
it("when don't have any implementation", async () => {
|
|
100
64
|
const props = {
|
|
101
65
|
groups: [["group", []]],
|
|
102
66
|
createRawImplementation: { method: "POST" },
|
|
@@ -104,12 +68,8 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
104
68
|
createImplementation: { method: "POST" },
|
|
105
69
|
columns,
|
|
106
70
|
};
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</Suspense>,
|
|
111
|
-
renderOpts
|
|
112
|
-
);
|
|
113
|
-
expect(container).toMatchSnapshot();
|
|
71
|
+
const rendered = render(<ConceptImplementationLinks {...props} />);
|
|
72
|
+
await waitForLoad(rendered);
|
|
73
|
+
expect(rendered.container).toMatchSnapshot();
|
|
114
74
|
});
|
|
115
75
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
3
1
|
import { useSearchContext } from "@truedat/core/search/SearchContext";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
3
|
import ConceptLinksActions from "../ConceptLinksActions";
|
|
5
4
|
|
|
6
5
|
jest.mock("@truedat/core/search/SearchContext", () => {
|
|
@@ -28,7 +27,7 @@ const renderOpts = {
|
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
describe("<ConceptLinksActions />", () => {
|
|
31
|
-
it("matches the latest snapshot with Grant Requests permission", () => {
|
|
30
|
+
it("matches the latest snapshot with Grant Requests permission", async () => {
|
|
32
31
|
useSearchContext.mockReturnValue({ searchData: [] });
|
|
33
32
|
|
|
34
33
|
const grRenderOpts = {
|
|
@@ -44,22 +43,22 @@ describe("<ConceptLinksActions />", () => {
|
|
|
44
43
|
},
|
|
45
44
|
};
|
|
46
45
|
|
|
47
|
-
const
|
|
46
|
+
const rendered = render(
|
|
48
47
|
<ConceptLinksActions onGrantViewChange={jest.fn()} />,
|
|
49
48
|
grRenderOpts
|
|
50
49
|
);
|
|
51
|
-
|
|
52
|
-
expect(container).toMatchSnapshot();
|
|
50
|
+
await waitForLoad(rendered);
|
|
51
|
+
expect(rendered.container).toMatchSnapshot();
|
|
53
52
|
});
|
|
54
53
|
|
|
55
|
-
it("matches the latest snapshot without Grant Requests permission", () => {
|
|
54
|
+
it("matches the latest snapshot without Grant Requests permission", async () => {
|
|
56
55
|
useSearchContext.mockReturnValue({ searchData: [] });
|
|
57
56
|
|
|
58
|
-
const
|
|
57
|
+
const rendered = render(
|
|
59
58
|
<ConceptLinksActions onGrantViewChange={jest.fn()} />,
|
|
60
59
|
renderOpts
|
|
61
60
|
);
|
|
62
|
-
|
|
63
|
-
expect(container).toMatchSnapshot();
|
|
61
|
+
await waitForLoad(rendered);
|
|
62
|
+
expect(rendered.container).toMatchSnapshot();
|
|
64
63
|
});
|
|
65
64
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { ConceptRelationActions } from "../ConceptRelationActions";
|
|
4
3
|
|
|
5
4
|
describe("<ConceptRelationActions />", () => {
|
|
6
|
-
it("matches the latest snapshot", () => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
it("matches the latest snapshot", async () => {
|
|
6
|
+
const props = {
|
|
7
|
+
addConceptRelation: "relation",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const rendered = render(<ConceptRelationActions {...props} />);
|
|
11
|
+
await waitForLoad(rendered);
|
|
12
|
+
expect(rendered.container).toMatchSnapshot();
|
|
11
13
|
});
|
|
12
14
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
3
|
-
import { waitFor } from "@testing-library/react";
|
|
4
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
3
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
4
|
import { linkTo } from "@truedat/core/routes";
|
|
6
5
|
import { ConceptRelationForm } from "../ConceptRelationForm";
|
|
7
|
-
import en from "../../../../messages/en";
|
|
8
6
|
|
|
9
7
|
const linkConcept = jest.fn();
|
|
10
8
|
|
|
@@ -71,6 +69,8 @@ jest.mock("@truedat/bg/concepts/hooks/useConcepts", () => {
|
|
|
71
69
|
};
|
|
72
70
|
});
|
|
73
71
|
|
|
72
|
+
jest.mock("@truedat/core/hooks/useUserFilters");
|
|
73
|
+
|
|
74
74
|
const concept = {
|
|
75
75
|
id: 1,
|
|
76
76
|
business_concept_id: 543,
|
|
@@ -89,70 +89,58 @@ const props = {
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
const renderOpts = {
|
|
92
|
-
messages: {
|
|
93
|
-
en: {
|
|
94
|
-
...en,
|
|
95
|
-
"actions.create": "create",
|
|
96
|
-
"actions.cancel": "cancel",
|
|
97
|
-
"search.save_filters": "save filters",
|
|
98
|
-
"search.clear_filters": "clear filters",
|
|
99
|
-
"search.applied_filters": "applied filters",
|
|
100
|
-
"relations.relationType": "relation type",
|
|
101
|
-
"search.placeholder": "Search concepts...",
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
92
|
state: {
|
|
105
93
|
tagOptions,
|
|
106
94
|
},
|
|
107
|
-
fallback: "lazy",
|
|
108
95
|
};
|
|
109
96
|
|
|
110
97
|
describe("<ConceptRelationForm />", () => {
|
|
111
98
|
it("matches the latest snapshot", async () => {
|
|
112
|
-
const {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
);
|
|
116
|
-
userEvent.click(await findByText(/some/));
|
|
99
|
+
const user = userEvent.setup({ delay: null });
|
|
100
|
+
const rendered = render(<ConceptRelationForm {...props} />, renderOpts);
|
|
101
|
+
await waitForLoad(rendered);
|
|
102
|
+
await user.click(await rendered.findByText(/some/i));
|
|
117
103
|
await waitFor(() => {
|
|
118
|
-
expect(container.querySelector(".loading")).toBeNull();
|
|
104
|
+
expect(rendered.container.querySelector(".loading")).toBeNull();
|
|
119
105
|
});
|
|
120
|
-
await findByText(/foo concept/);
|
|
121
|
-
expect(container).toMatchSnapshot();
|
|
106
|
+
await rendered.findByText(/foo concept/i);
|
|
107
|
+
expect(rendered.container).toMatchSnapshot();
|
|
122
108
|
});
|
|
123
109
|
|
|
124
110
|
it("handles tag and concept selection", async () => {
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
111
|
+
const user = userEvent.setup({ delay: null });
|
|
112
|
+
const rendered = render(<ConceptRelationForm {...props} />, renderOpts);
|
|
113
|
+
await waitForLoad(rendered);
|
|
114
|
+
|
|
129
115
|
await waitFor(() => {
|
|
130
|
-
expect(getByRole("button", { name:
|
|
116
|
+
expect(rendered.getByRole("button", { name: /create/i })).toBeDisabled();
|
|
131
117
|
});
|
|
132
118
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
await user.click(await rendered.findByText(/bar concept/i));
|
|
120
|
+
await user.click(
|
|
121
|
+
await rendered.findByRole("option", { name: /relates_to/i })
|
|
122
|
+
);
|
|
136
123
|
|
|
137
124
|
await waitFor(() => {
|
|
138
|
-
expect(getByRole("button", { name:
|
|
125
|
+
expect(rendered.getByRole("button", { name: /create/i })).toBeEnabled();
|
|
139
126
|
});
|
|
140
127
|
});
|
|
141
128
|
|
|
142
129
|
it("submits the selected relation", async () => {
|
|
143
|
-
const {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
);
|
|
147
|
-
userEvent.click(await findByText("bar concept"));
|
|
130
|
+
const user = userEvent.setup({ delay: null });
|
|
131
|
+
const rendered = render(<ConceptRelationForm {...props} />, renderOpts);
|
|
132
|
+
await waitForLoad(rendered);
|
|
148
133
|
|
|
149
|
-
|
|
134
|
+
await user.click(await rendered.findByText(/bar concept/i));
|
|
135
|
+
await user.click(
|
|
136
|
+
await rendered.findByRole("option", { name: /relates_to/i })
|
|
137
|
+
);
|
|
150
138
|
|
|
151
139
|
await waitFor(() => {
|
|
152
|
-
expect(getByRole("button", { name:
|
|
140
|
+
expect(rendered.getByRole("button", { name: /create/i })).toBeEnabled();
|
|
153
141
|
});
|
|
154
142
|
|
|
155
|
-
|
|
143
|
+
await user.click(rendered.getByRole("button", { name: /create/i }));
|
|
156
144
|
|
|
157
145
|
const expectedRelation = {
|
|
158
146
|
redirectUrl: linkTo.CONCEPT_LINKS_CONCEPTS(concept),
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { ConceptRelationRow } from "../ConceptRelationRow";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
jest.mock("react-router-dom", () => ({
|
|
10
|
-
...jest.requireActual("react-router-dom"),
|
|
11
|
-
useHistory: () => mockHistory
|
|
4
|
+
jest.mock("react-router", () => ({
|
|
5
|
+
...jest.requireActual("react-router"),
|
|
6
|
+
useNavigate: () => jest.fn(),
|
|
12
7
|
}));
|
|
13
8
|
|
|
14
9
|
describe("<ConceptRelationRow />", () => {
|
|
@@ -17,24 +12,24 @@ describe("<ConceptRelationRow />", () => {
|
|
|
17
12
|
const canDeleteConceptRelation = true;
|
|
18
13
|
const relationContext = {
|
|
19
14
|
target: { id: 1, name: "target" },
|
|
20
|
-
source: { id: 2, name: "source" }
|
|
15
|
+
source: { id: 2, name: "source" },
|
|
21
16
|
};
|
|
22
17
|
const tags = [];
|
|
23
18
|
|
|
24
|
-
it("matches the latest snapshot", () => {
|
|
19
|
+
it("matches the latest snapshot", async () => {
|
|
25
20
|
const deleteConceptRelation = jest.fn();
|
|
26
|
-
const history = { push: jest.fn() };
|
|
27
21
|
|
|
28
22
|
const props = {
|
|
29
23
|
canDeleteConceptRelation,
|
|
30
24
|
concept_id,
|
|
31
25
|
deleteConceptRelation,
|
|
32
|
-
history,
|
|
33
26
|
id,
|
|
34
27
|
relationContext,
|
|
35
|
-
tags
|
|
28
|
+
tags,
|
|
36
29
|
};
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
|
|
31
|
+
const rendered = render(<ConceptRelationRow {...props} />);
|
|
32
|
+
await waitForLoad(rendered);
|
|
33
|
+
expect(rendered.container).toMatchSnapshot();
|
|
39
34
|
});
|
|
40
35
|
});
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { intl } from "@truedat/test/intl-stub";
|
|
3
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
2
|
import { ConceptRelations } from "../ConceptRelations";
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
jest.spyOn(React, "useContext").mockImplementation(() => intl);
|
|
9
|
-
|
|
10
|
-
jest.mock("react-router-dom", () => ({
|
|
11
|
-
...jest.requireActual("react-router-dom"),
|
|
4
|
+
jest.mock("react-router", () => ({
|
|
5
|
+
...jest.requireActual("react-router"),
|
|
12
6
|
useLocation: () => ({ pathname: "/bar" }),
|
|
13
|
-
|
|
7
|
+
useNavigate: () => jest.fn(),
|
|
14
8
|
}));
|
|
15
9
|
|
|
16
10
|
describe("<ConceptRelations />", () => {
|
|
17
|
-
it("matches the latest snapshot", () => {
|
|
11
|
+
it("matches the latest snapshot", async () => {
|
|
18
12
|
const props = {
|
|
19
13
|
concept: { business_concept_id: 1 },
|
|
20
14
|
conceptRelationsLoading: false,
|
|
21
|
-
conceptRelations: []
|
|
15
|
+
conceptRelations: [],
|
|
16
|
+
relationsGraph: {},
|
|
22
17
|
};
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
|
|
19
|
+
const rendered = render(<ConceptRelations {...props} />);
|
|
20
|
+
await waitForLoad(rendered);
|
|
21
|
+
expect(rendered.container).toMatchSnapshot();
|
|
25
22
|
});
|
|
26
23
|
});
|
|
@@ -1,13 +1,113 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
|
+
import ConceptRelationsRoutes from "../ConceptRelationsRoutes";
|
|
4
|
+
import {
|
|
5
|
+
CONCEPT_LINKS_CONCEPTS,
|
|
6
|
+
CONCEPT_LINKS_CONCEPTS_NEW,
|
|
7
|
+
CONCEPT_LINKS_STRUCTURES,
|
|
8
|
+
CONCEPT_LINKS_STRUCTURES_NEW,
|
|
9
|
+
CONCEPT_LINKS_IMPLEMENTATIONS,
|
|
10
|
+
} from "@truedat/core/routes";
|
|
11
|
+
|
|
12
|
+
// Mock child components
|
|
13
|
+
jest.mock("@truedat/lm/components/ConceptStructureLinkForm", () => () => (
|
|
14
|
+
<div>ConceptStructureLinkForm</div>
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
jest.mock("@truedat/dd/components/StructureTypesLoader", () => () => (
|
|
18
|
+
<div>StructureTypesLoader</div>
|
|
19
|
+
));
|
|
20
|
+
|
|
21
|
+
jest.mock("../ConceptStructureLinks", () => () => (
|
|
22
|
+
<div>ConceptStructureLinks</div>
|
|
23
|
+
));
|
|
24
|
+
|
|
25
|
+
jest.mock("../ConceptRelations", () => () => <div>ConceptRelations</div>);
|
|
26
|
+
|
|
27
|
+
jest.mock("../ConceptRelationForm", () => () => <div>ConceptRelationForm</div>);
|
|
28
|
+
|
|
29
|
+
jest.mock("../ConceptImplementationLinks", () => () => (
|
|
30
|
+
<div>ConceptImplementationLinks</div>
|
|
31
|
+
));
|
|
4
32
|
|
|
5
33
|
describe("<ConceptRelationsRoutes />", () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
34
|
+
const renderOpts = {
|
|
35
|
+
state: {
|
|
36
|
+
concept: {
|
|
37
|
+
business_concept_id: 1,
|
|
38
|
+
name: "Test Concept",
|
|
39
|
+
id: "1",
|
|
40
|
+
version: "1.0",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
it("renders correctly with default route", async () => {
|
|
46
|
+
const rendered = render(<ConceptRelationsRoutes />, renderOpts);
|
|
47
|
+
await waitForLoad(rendered);
|
|
48
|
+
expect(rendered.container).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("renders correctly with structures route", async () => {
|
|
52
|
+
const rendered = render(<ConceptRelationsRoutes />, {
|
|
53
|
+
...renderOpts,
|
|
54
|
+
routes: [CONCEPT_LINKS_STRUCTURES],
|
|
55
|
+
});
|
|
56
|
+
await waitForLoad(rendered);
|
|
57
|
+
expect(rendered.container).toMatchSnapshot();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("renders correctly with new structure link route", async () => {
|
|
61
|
+
const rendered = render(<ConceptRelationsRoutes />, {
|
|
62
|
+
...renderOpts,
|
|
63
|
+
routes: [CONCEPT_LINKS_STRUCTURES_NEW],
|
|
64
|
+
});
|
|
65
|
+
await waitForLoad(rendered);
|
|
66
|
+
expect(rendered.container).toMatchSnapshot();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("renders correctly with concepts route", async () => {
|
|
70
|
+
const rendered = render(<ConceptRelationsRoutes />, {
|
|
71
|
+
...renderOpts,
|
|
72
|
+
routes: [CONCEPT_LINKS_CONCEPTS],
|
|
73
|
+
});
|
|
74
|
+
await waitForLoad(rendered);
|
|
75
|
+
expect(rendered.container).toMatchSnapshot();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("renders correctly with new concept relation route", async () => {
|
|
79
|
+
const rendered = render(<ConceptRelationsRoutes />, {
|
|
80
|
+
...renderOpts,
|
|
81
|
+
routes: [CONCEPT_LINKS_CONCEPTS_NEW],
|
|
82
|
+
});
|
|
83
|
+
await waitForLoad(rendered);
|
|
84
|
+
expect(rendered.container).toMatchSnapshot();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("renders correctly with implementations route", async () => {
|
|
88
|
+
const rendered = render(<ConceptRelationsRoutes />, {
|
|
89
|
+
...renderOpts,
|
|
90
|
+
routes: [CONCEPT_LINKS_IMPLEMENTATIONS],
|
|
91
|
+
});
|
|
92
|
+
await waitForLoad(rendered);
|
|
93
|
+
expect(rendered.container).toMatchSnapshot();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("renders nothing when concept is not loaded", async () => {
|
|
97
|
+
const rendered = render(<ConceptRelationsRoutes />, {
|
|
98
|
+
...renderOpts,
|
|
99
|
+
state: { concept: {} },
|
|
100
|
+
});
|
|
101
|
+
await waitForLoad(rendered);
|
|
102
|
+
expect(rendered.container).toMatchSnapshot();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("renders nothing when relations are loading", async () => {
|
|
106
|
+
const rendered = render(<ConceptRelationsRoutes />, {
|
|
107
|
+
...renderOpts,
|
|
108
|
+
state: { ...renderOpts.state, relationsLoading: true },
|
|
109
|
+
});
|
|
110
|
+
await waitForLoad(rendered);
|
|
111
|
+
expect(rendered.container).toMatchSnapshot();
|
|
12
112
|
});
|
|
13
113
|
});
|