@truedat/dd 8.12.5 → 8.12.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "8.12.5",
3
+ "version": "8.12.6",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -54,7 +54,7 @@
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.5",
57
+ "@truedat/test": "8.12.6",
58
58
  "identity-obj-proxy": "^3.0.0",
59
59
  "jest": "^29.7.0",
60
60
  "redux-saga-test-plan": "^4.0.6"
@@ -90,5 +90,5 @@
90
90
  "svg-pan-zoom": "^3.6.2",
91
91
  "swr": "^2.3.3"
92
92
  },
93
- "gitHead": "71dd08262e6c26dd25466154c49fadb7b3449bd7"
93
+ "gitHead": "fe7375c2d3c6ebdaf3dacd985f56433eda477712"
94
94
  }
@@ -24,18 +24,27 @@ const linksField = (field) =>
24
24
  (s) => s.kind === "Field" && s.name.value === "links",
25
25
  );
26
26
 
27
- const expectRelationLinks = (document) => {
27
+ const expectResourceType = (field, value) => {
28
+ const resourceType = linksField(field).arguments.find(
29
+ (argument) => argument.name.value === "resource_type",
30
+ );
31
+ expect(resourceType.value.value).toBe(value);
32
+ };
33
+
34
+ const expectRelationLinks = (document, childrenResourceType) => {
28
35
  const parents = fieldAtPath(document, PARENT_PATH);
29
36
  const children = fieldAtPath(document, CHILD_PATH);
30
37
 
31
38
  expect(selectionNames(parents)).toEqual(expect.arrayContaining(["links"]));
32
39
  expect(selectionNames(children)).toEqual(expect.arrayContaining(["links"]));
33
40
 
34
- const resourceType = linksField(parents).arguments.find(
35
- (argument) => argument.name.value === "resource_type",
36
- );
37
- expect(resourceType.value.value).toBe("business_concept");
38
- expect(linksField(children).arguments).toEqual([]);
41
+ expectResourceType(parents, "business_concept");
42
+
43
+ if (childrenResourceType) {
44
+ expectResourceType(children, childrenResourceType);
45
+ } else {
46
+ expect(linksField(children).arguments).toEqual([]);
47
+ }
39
48
  };
40
49
 
41
50
  describe("LEGACY_DATA_STRUCTURE_VERSION_QUERY", () => {
@@ -46,10 +55,10 @@ describe("LEGACY_DATA_STRUCTURE_VERSION_QUERY", () => {
46
55
 
47
56
  describe("buildDSVQuery", () => {
48
57
  it("requests concept links on parent and child structure relations", () => {
49
- expectRelationLinks(buildDSVQuery(false));
58
+ expectRelationLinks(buildDSVQuery(false), "business_concept");
50
59
  });
51
60
 
52
61
  it("requests concept links on parent and child structure relations when loading metadata", () => {
53
- expectRelationLinks(buildDSVQuery(true));
62
+ expectRelationLinks(buildDSVQuery(true), "business_concept");
54
63
  });
55
64
  });
@@ -687,7 +687,7 @@ export const buildDSVQuery = (loadStructureMetadata) => gql`
687
687
  name
688
688
  description
689
689
  }
690
- links
690
+ links(resource_type: "business_concept")
691
691
  }
692
692
  }
693
693