@truedat/bg 7.5.11 → 7.5.12

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": "7.5.11",
3
+ "version": "7.5.12",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -46,34 +46,34 @@
46
46
  "devDependencies": {
47
47
  "@testing-library/dom": "^10.4.0",
48
48
  "@testing-library/jest-dom": "^6.6.3",
49
- "@testing-library/react": "^16.2.0",
49
+ "@testing-library/react": "^16.3.0",
50
50
  "@testing-library/user-event": "^14.6.1",
51
- "@truedat/test": "7.5.11",
51
+ "@truedat/test": "7.5.12",
52
52
  "identity-obj-proxy": "^3.0.0",
53
53
  "jest": "^29.7.0",
54
54
  "redux-saga-test-plan": "^4.0.6"
55
55
  },
56
56
  "dependencies": {
57
- "@apollo/client": "^3.13.5",
58
- "axios": "^1.8.4",
57
+ "@apollo/client": "^3.13.8",
58
+ "axios": "^1.9.0",
59
59
  "file-saver": "^2.0.5",
60
- "graphql": "^16.10.0",
60
+ "graphql": "^16.11.0",
61
61
  "is-hotkey": "^0.2.0",
62
62
  "is-url": "^1.2.4",
63
63
  "lodash": "^4.17.21",
64
64
  "moment": "^2.30.1",
65
65
  "path-to-regexp": "^8.2.0",
66
66
  "prop-types": "^15.8.1",
67
- "query-string": "^7.1.2",
68
- "react": "^19.0.0",
67
+ "query-string": "^7.1.3",
68
+ "react": "^19.1.0",
69
69
  "react-csv": "^2.2.2",
70
- "react-dom": "^19.0.0",
70
+ "react-dom": "^19.1.0",
71
71
  "react-dropzone": "^14.3.8",
72
- "react-hook-form": "^7.54.2",
73
- "react-intl": "^7.1.10",
72
+ "react-hook-form": "^7.56.4",
73
+ "react-intl": "^7.1.11",
74
74
  "react-moment": "^1.1.3",
75
75
  "react-redux": "^9.2.0",
76
- "react-router": "^7.4.0",
76
+ "react-router": "^7.6.0",
77
77
  "redux": "^5.0.1",
78
78
  "redux-saga": "^1.3.0",
79
79
  "redux-saga-routines": "^3.2.3",
@@ -82,5 +82,5 @@
82
82
  "semantic-ui-react": "^3.0.0-beta.2",
83
83
  "swr": "^2.3.3"
84
84
  },
85
- "gitHead": "cbb92d5206752fe2add4195432b0401da17a0f23"
85
+ "gitHead": "1476061ceb9ed15e0bacec71e20d695a0cd57986"
86
86
  }
@@ -79,7 +79,7 @@ describe("<Domain />", () => {
79
79
  });
80
80
 
81
81
  it("renders null when domain is not available", async () => {
82
- useDomain.mockImplementationOnce(() => ({
82
+ useDomain.mockImplementation(() => ({
83
83
  data: null,
84
84
  }));
85
85
 
@@ -6,82 +6,81 @@ import { useDomains } from "../../../hooks/useDomains";
6
6
 
7
7
  jest.mock("../../../hooks/useDomains", () => ({
8
8
  ...jest.requireActual("../../../hooks/useDomains"),
9
- useDomains: jest.fn(() => ({
10
- data: [
11
- {
12
- description: "No tiene padre",
13
- domain_group: null,
14
- external_id: "1",
15
- id: 1,
16
- name: "domain_1",
17
- parent_id: null,
18
- parents: null,
19
- type: null,
20
- },
21
- {
22
- description: "No tiene padre",
23
- domain_group: null,
24
- external_id: "2",
25
- id: 2,
26
- name: "domain_2",
27
- parent_id: null,
28
- parents: null,
29
- type: null,
30
- },
31
- {
32
- description: "el padre es domain_2",
33
- domain_group: null,
34
- external_id: "3",
35
- id: 3,
36
- name: "domain_3",
37
- parent_id: 2,
38
- parents: null,
39
- type: null,
40
- },
41
- {
42
- description: "el padre es domain_2",
43
- domain_group: null,
44
- external_id: "4",
45
- id: 4,
46
- name: "domain_4",
47
- parent_id: 2,
48
- parents: null,
49
- type: null,
50
- },
51
- {
52
- description: "No tiene padre",
53
- domain_group: null,
54
- external_id: "5",
55
- id: 5,
56
- name: "domain_5",
57
- parent_id: null,
58
- parents: null,
59
- type: null,
60
- },
61
- {
62
- description: "el padre es domain_5",
63
- domain_group: null,
64
- external_id: "6",
65
- id: 6,
66
- name: "domain_6",
67
- parent_id: 5,
68
- parents: null,
69
- type: null,
70
- },
71
- {
72
- description: "el padre es domain_6",
73
- domain_group: null,
74
- external_id: "7",
75
- id: 7,
76
- name: "domain_7",
77
- parent_id: 6,
78
- parents: null,
79
- type: null,
80
- },
81
- ],
82
- })),
9
+ useDomains: jest.fn(() => {}),
83
10
  }));
84
11
 
12
+ const data = [
13
+ {
14
+ description: "No tiene padre",
15
+ domain_group: null,
16
+ external_id: "1",
17
+ id: 1,
18
+ name: "domain_1",
19
+ parent_id: null,
20
+ parents: null,
21
+ type: null,
22
+ },
23
+ {
24
+ description: "No tiene padre",
25
+ domain_group: null,
26
+ external_id: "2",
27
+ id: 2,
28
+ name: "domain_2",
29
+ parent_id: null,
30
+ parents: null,
31
+ type: null,
32
+ },
33
+ {
34
+ description: "el padre es domain_2",
35
+ domain_group: null,
36
+ external_id: "3",
37
+ id: 3,
38
+ name: "domain_3",
39
+ parent_id: 2,
40
+ parents: null,
41
+ type: null,
42
+ },
43
+ {
44
+ description: "el padre es domain_2",
45
+ domain_group: null,
46
+ external_id: "4",
47
+ id: 4,
48
+ name: "domain_4",
49
+ parent_id: 2,
50
+ parents: null,
51
+ type: null,
52
+ },
53
+ {
54
+ description: "No tiene padre",
55
+ domain_group: null,
56
+ external_id: "5",
57
+ id: 5,
58
+ name: "domain_5",
59
+ parent_id: null,
60
+ parents: null,
61
+ type: null,
62
+ },
63
+ {
64
+ description: "el padre es domain_5",
65
+ domain_group: null,
66
+ external_id: "6",
67
+ id: 6,
68
+ name: "domain_6",
69
+ parent_id: 5,
70
+ parents: null,
71
+ type: null,
72
+ },
73
+ {
74
+ description: "el padre es domain_6",
75
+ domain_group: null,
76
+ external_id: "7",
77
+ id: 7,
78
+ name: "domain_7",
79
+ parent_id: 6,
80
+ parents: null,
81
+ type: null,
82
+ },
83
+ ];
85
84
  describe("<DomainForm />", () => {
86
85
  const onSubmit = jest.fn();
87
86
  const domain = { id: 1, name: "nn", external_id: "foo", description: "dd" };
@@ -89,12 +88,14 @@ describe("<DomainForm />", () => {
89
88
  const props = { domain, onSubmit, isSubmitting };
90
89
 
91
90
  it("matches the latest snapshot", async () => {
91
+ useDomains.mockImplementation(() => ({ data }));
92
92
  const rendered = render(<DomainForm {...props} />);
93
93
  await waitForLoad(rendered);
94
94
  expect(rendered.container).toMatchSnapshot();
95
95
  });
96
96
 
97
97
  it("enables submit when required fields have values", async () => {
98
+ useDomains.mockImplementation(() => ({ data }));
98
99
  const props = { domain: {}, onSubmit: jest.fn() };
99
100
  const rendered = render(<DomainForm {...props} />);
100
101
  await waitForLoad(rendered);
@@ -121,7 +122,7 @@ describe("<DomainForm />", () => {
121
122
  });
122
123
 
123
124
  it("should generate unique domain group options", async () => {
124
- useDomains.mockImplementationOnce(() => ({
125
+ useDomains.mockImplementation(() => ({
125
126
  data: [
126
127
  { domain_group: { name: "DomainGroup1" } },
127
128
  { domain_group: { name: "DomainGroup2" } },
@@ -149,7 +150,7 @@ describe("<DomainForm />", () => {
149
150
  });
150
151
 
151
152
  it("should generate unique type options", async () => {
152
- useDomains.mockImplementationOnce(() => ({
153
+ useDomains.mockImplementation(() => ({
153
154
  data: [
154
155
  { type: "Type1" },
155
156
  { type: "Type2" },
@@ -172,6 +173,7 @@ describe("<DomainForm />", () => {
172
173
  });
173
174
 
174
175
  it("should generate domain parent options", async () => {
176
+ useDomains.mockImplementation(() => ({ data }));
175
177
  const domain = { id: 2, parentable_ids: [1, 5, 6, 7] };
176
178
 
177
179
  const rendered = render(
@@ -162,8 +162,8 @@ describe("<Domains />", () => {
162
162
 
163
163
  it("redirects to domains list if domainId is invalid", async () => {
164
164
  const mockHistoryPush = jest.fn();
165
- useNavigate.mockImplementationOnce(() => mockHistoryPush);
166
- useParams.mockImplementationOnce(() => ({ id: 999 }));
165
+ useNavigate.mockImplementation(() => mockHistoryPush);
166
+ useParams.mockImplementation(() => ({ id: 999 }));
167
167
 
168
168
  const rendered = render(<Domains />, renderOpts);
169
169
  await waitForLoad(rendered);
@@ -172,14 +172,14 @@ describe("<Domains />", () => {
172
172
  });
173
173
 
174
174
  it("renders EmptyImage when no domains available", async () => {
175
- useParams.mockImplementationOnce(() => ({ id: undefined }));
176
- useDomains.mockImplementationOnce(() => ({
175
+ useParams.mockImplementation(() => ({ id: undefined }));
176
+ useDomains.mockImplementation(() => ({
177
177
  data: [],
178
178
  actions: {},
179
179
  loading: false,
180
180
  }));
181
181
  const mockHistoryPush = jest.fn();
182
- useNavigate.mockImplementationOnce(() => mockHistoryPush);
182
+ useNavigate.mockImplementation(() => mockHistoryPush);
183
183
 
184
184
  const rendered = render(<Domains />, renderOpts);
185
185
  await waitForLoad(rendered);