@truedat/bg 6.12.0 → 6.12.2

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/bg",
3
- "version": "6.12.0",
3
+ "version": "6.12.2",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -86,9 +86,9 @@
86
86
  ]
87
87
  },
88
88
  "dependencies": {
89
- "@truedat/core": "6.12.0",
90
- "@truedat/df": "6.12.0",
91
- "@truedat/lm": "6.12.0",
89
+ "@truedat/core": "6.12.2",
90
+ "@truedat/df": "6.12.2",
91
+ "@truedat/lm": "6.12.2",
92
92
  "decode-uri-component": "^0.2.2",
93
93
  "file-saver": "^2.0.5",
94
94
  "moment": "^2.29.4",
@@ -111,5 +111,5 @@
111
111
  "react-dom": ">= 16.8.6 < 17",
112
112
  "semantic-ui-react": ">= 2.0.3 < 2.2"
113
113
  },
114
- "gitHead": "a182d4660919ab242d3150ef4a51641815913a39"
114
+ "gitHead": "e0acd68539a1ed3786de65ab4fa4221455ea90a4"
115
115
  }
@@ -1,5 +1,6 @@
1
1
  import React, { Suspense } from "react";
2
2
  import { render } from "@truedat/test/render";
3
+ import { waitFor } from "@testing-library/react";
3
4
  import userEvent from "@testing-library/user-event";
4
5
  import ConceptsLinksManagement from "../ConceptsLinksManagement";
5
6
  import en from "../../../messages/en";
@@ -108,23 +109,27 @@ describe("<ConceptsLinksManagement />", () => {
108
109
  };
109
110
 
110
111
  it("matches the latest snapshot", async () => {
111
- const { container, queryByText } = render(
112
+ const { container, findByText } = render(
112
113
  <ConceptsLinksManagement {...props} />,
113
114
  renderOpts
114
115
  );
115
- userEvent.click(await queryByText(/some/));
116
+ userEvent.click(await findByText(/some/));
117
+ await waitFor(() => {
118
+ expect(container.querySelector(".loading")).toBeNull();
119
+ });
120
+ await findByText(/18/);
116
121
  expect(container).toMatchSnapshot();
117
122
  });
118
123
 
119
124
  it("select a concept and shows LinkedMessage and structure search table", async () => {
120
- const { queryByText } = render(
125
+ const { findByText, queryByText } = render(
121
126
  <Suspense fallback={null}>
122
127
  <ConceptsLinksManagement {...props} />
123
128
  </Suspense>,
124
129
  renderOpts
125
130
  );
126
131
 
127
- userEvent.click(await queryByText(/foo/));
132
+ userEvent.click(await findByText(/foo/));
128
133
  expect(queryByText("Adding a link to a structure")).toBeInTheDocument();
129
134
  });
130
135
  });
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { render } from "@truedat/test/render";
3
+ import { waitFor } from "@testing-library/react";
3
4
  import { Concepts } from "../Concepts";
4
5
  import { defaultConceptColumns } from "../../selectors";
5
6
 
@@ -65,7 +66,7 @@ const state = {
65
66
  };
66
67
 
67
68
  describe("<Concepts />", () => {
68
- it("matches the latest snapshot", () => {
69
+ it("matches the latest snapshot", async () => {
69
70
  const renderOpts = {
70
71
  messages,
71
72
  state,
@@ -85,7 +86,15 @@ describe("<Concepts />", () => {
85
86
  update,
86
87
  create,
87
88
  };
88
- const { container } = render(<Concepts {...props} />, renderOpts);
89
+ const { container, findByText } = render(
90
+ <Concepts {...props} />,
91
+ renderOpts
92
+ );
93
+ await waitFor(() => {
94
+ expect(container.querySelector(".loading")).toBeNull();
95
+ });
96
+
97
+ await findByText(/7/);
89
98
  expect(container).toMatchSnapshot();
90
99
  });
91
100
  });
@@ -63,13 +63,14 @@ describe("<ConceptsActions />", () => {
63
63
  },
64
64
  };
65
65
 
66
- it("matches the latest snapshot", () => {
67
- const { container } = render(
66
+ it("matches the latest snapshot", async () => {
67
+ const { container, findByText } = render(
68
68
  <SearchContextProvider {...searchProps}>
69
69
  <ConceptsActions {...props} />
70
70
  </SearchContextProvider>,
71
71
  renderOpts
72
72
  );
73
+ await findByText(/Create/);
73
74
  expect(container).toMatchSnapshot();
74
75
  });
75
76
  });
@@ -31,12 +31,13 @@ const searchProps = {
31
31
  };
32
32
 
33
33
  describe("<ConceptsLabelResults />", () => {
34
- it("matches the latest snapshot", () => {
35
- const { container } = render(
34
+ it("matches the latest snapshot", async () => {
35
+ const { container, findByText } = render(
36
36
  <SearchContextProvider {...searchProps} defaultFilters={defaultFilters}>
37
37
  <ConceptsLabelResults />
38
38
  </SearchContextProvider>
39
39
  );
40
+ await findByText(/22 concepts found/);
40
41
  expect(container).toMatchSnapshot();
41
42
  });
42
43
  });
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { render } from "@truedat/test/render";
3
+ import { waitFor } from "@testing-library/react";
3
4
  import ConceptsPanel from "../ConceptsPanel";
4
5
  import { defaultConceptColumns } from "../../selectors";
5
6
 
@@ -72,8 +73,15 @@ describe("<ConceptsPanel />", () => {
72
73
  const props = {
73
74
  defaultFilters: {},
74
75
  };
75
- it("matches latest snapshot", () => {
76
- const { container } = render(<ConceptsPanel {...props} />, renderOpts);
76
+ it("matches latest snapshot", async () => {
77
+ const { container, findByText } = render(
78
+ <ConceptsPanel {...props} />,
79
+ renderOpts
80
+ );
81
+ await waitFor(() => {
82
+ expect(container.querySelector(".loading")).toBeNull();
83
+ });
84
+ await findByText(/7/);
77
85
  expect(container).toMatchSnapshot();
78
86
  });
79
87
  });
@@ -60,7 +60,7 @@ const renderOpts = {
60
60
  };
61
61
 
62
62
  describe("<ConceptsTable />", () => {
63
- it("matches the latest snapshot", () => {
63
+ it("matches the latest snapshot", async () => {
64
64
  const defaultColumns = ["name", "status"].map((name) => ({ name }));
65
65
  const columnsByScope = {
66
66
  concepts: [...defaultColumns],
@@ -68,12 +68,13 @@ describe("<ConceptsTable />", () => {
68
68
  };
69
69
 
70
70
  const props = { columnsByScope };
71
- const { container } = render(
71
+ const { container, findByText } = render(
72
72
  <SearchContextProvider {...searchProps} defaultFilters={defaultFilters}>
73
73
  <ConceptsTable {...props} />
74
74
  </SearchContextProvider>,
75
75
  renderOpts
76
76
  );
77
+ await findByText(/Type/);
77
78
  expect(container).toMatchSnapshot();
78
79
  });
79
80
  });
@@ -109,11 +109,15 @@ const renderOpts = {
109
109
 
110
110
  describe("<ConceptRelationForm />", () => {
111
111
  it("matches the latest snapshot", async () => {
112
- const { container, queryByText } = render(
112
+ const { container, findByText } = render(
113
113
  <ConceptRelationForm {...props} />,
114
114
  renderOpts
115
115
  );
116
- userEvent.click(await queryByText(/some/));
116
+ userEvent.click(await findByText(/some/));
117
+ await waitFor(() => {
118
+ expect(container.querySelector(".loading")).toBeNull();
119
+ });
120
+ await findByText(/foo concept/);
117
121
  expect(container).toMatchSnapshot();
118
122
  });
119
123
 
@@ -83,11 +83,14 @@ describe("<ConceptSelector />", () => {
83
83
  handleConceptSelected,
84
84
  };
85
85
  it("matches the latest snapshot", async () => {
86
- const { container, queryByText } = render(
86
+ const { container, findByText } = render(
87
87
  <ConceptSelector {...props} />,
88
88
  renderOpts
89
89
  );
90
- userEvent.click(await queryByText(/some/));
90
+ userEvent.click(await findByText(/some/));
91
+ await waitFor(() => {
92
+ expect(container.querySelector(".loading")).toBeNull();
93
+ });
91
94
  expect(container).toMatchSnapshot();
92
95
  });
93
96
 
@@ -105,12 +108,12 @@ describe("<ConceptSelector />", () => {
105
108
  });
106
109
 
107
110
  it("calls handleConceptSelected on concept row click", async () => {
108
- const { queryByText } = render(
111
+ const { findByText } = render(
109
112
  <ConceptSelector {...{ ...props, selectedConcept: null }} />,
110
113
  renderOpts
111
114
  );
112
115
 
113
- userEvent.click(await queryByText(/foo/i));
116
+ userEvent.click(await findByText(/foo/i));
114
117
  await waitFor(() =>
115
118
  expect(handleConceptSelected.mock.calls.length).toBe(1)
116
119
  );
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { waitFor } from "@testing-library/react";
2
3
  import { render } from "@truedat/test/render";
3
4
  import ConceptSelector from "../ConceptSelector";
4
5
  import en from "../../../../messages/en";
@@ -65,8 +66,11 @@ describe("<ConceptSelector />", () => {
65
66
  handleConceptSelected,
66
67
  };
67
68
 
68
- it("renders disable when cannot create structure link", () => {
69
+ it("renders disable when cannot create structure link", async () => {
69
70
  const { container } = render(<ConceptSelector {...props} />, renderOpts);
71
+ await waitFor(() => {
72
+ expect(container.querySelector(".loading")).toBeNull();
73
+ });
70
74
  expect(container.querySelector("tbody > tr")).toHaveClass("disabled");
71
75
  });
72
76
  });
@@ -4,16 +4,69 @@ exports[`<ConceptRelationForm /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <div
6
6
  class="field concept-relation-form"
7
- style="display: none;"
8
- />
7
+ style=""
8
+ >
9
+ <div
10
+ class="field"
11
+ >
12
+ <b>
13
+ <label>
14
+ relation type
15
+ </label>
16
+ </b>
17
+ <div>
18
+ <div
19
+ aria-expanded="false"
20
+ class="ui selection dropdown concept-link-dropdown"
21
+ role="listbox"
22
+ tabindex="0"
23
+ >
24
+ <i
25
+ aria-hidden="true"
26
+ class="dropdown icon"
27
+ />
28
+ <div
29
+ class="menu transition"
30
+ >
31
+ <div
32
+ aria-checked="false"
33
+ aria-selected="true"
34
+ class="selected item"
35
+ role="option"
36
+ style="pointer-events: all;"
37
+ >
38
+ <span
39
+ class="text"
40
+ >
41
+ -
42
+ </span>
43
+ </div>
44
+ <div
45
+ aria-checked="false"
46
+ aria-selected="false"
47
+ class="item"
48
+ role="option"
49
+ style="pointer-events: all;"
50
+ >
51
+ <span
52
+ class="text"
53
+ >
54
+ relates_to
55
+ </span>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
9
62
  <label
10
- style="display: none;"
63
+ style=""
11
64
  >
12
65
  Related concept
13
66
  </label>
14
67
  <div
15
68
  class="ui segment"
16
- style="display: none;"
69
+ style=""
17
70
  >
18
71
  <div
19
72
  class="ui action left icon input"
@@ -213,7 +266,7 @@ exports[`<ConceptRelationForm /> matches the latest snapshot 1`] = `
213
266
  </div>
214
267
  <div
215
268
  class="ui buttons"
216
- style="display: none;"
269
+ style=""
217
270
  >
218
271
  <button
219
272
  class="ui primary disabled button"
@@ -230,6 +283,5 @@ exports[`<ConceptRelationForm /> matches the latest snapshot 1`] = `
230
283
  cancel
231
284
  </a>
232
285
  </div>
233
- lazy
234
286
  </div>
235
287
  `;
@@ -71,13 +71,15 @@ describe("<DomainStructures />", () => {
71
71
  state: { domain: { id: 1, name: "domain" } },
72
72
  };
73
73
 
74
- it("matches the latest snapshot", () => {
75
- const { container } = render(
74
+ it("matches the latest snapshot", async () => {
75
+ const { container, findByText } = render(
76
76
  <SearchContextWrapper>
77
77
  <DomainStructures />
78
78
  </SearchContextWrapper>,
79
79
  renderOpts
80
80
  );
81
+ await findByText(/No structures have been found matching these filters./);
82
+
81
83
  expect(container).toMatchSnapshot();
82
84
  });
83
85
  });