@truedat/core 8.12.2 → 8.12.5

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/core",
3
- "version": "8.12.2",
3
+ "version": "8.12.5",
4
4
  "description": "Truedat Web Core",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -57,7 +57,7 @@
57
57
  "@testing-library/jest-dom": "^6.6.3",
58
58
  "@testing-library/react": "^16.3.0",
59
59
  "@testing-library/user-event": "^14.6.1",
60
- "@truedat/test": "8.12.2",
60
+ "@truedat/test": "8.12.5",
61
61
  "identity-obj-proxy": "^3.0.0",
62
62
  "jest": "^29.7.0",
63
63
  "redux-saga-test-plan": "^4.0.6"
@@ -99,5 +99,5 @@
99
99
  "swr": "^2.3.3",
100
100
  "turndown": "^7.2.2"
101
101
  },
102
- "gitHead": "b0000f1b2727cad43ce3c3eb2fa29681488dd2ec"
102
+ "gitHead": "71dd08262e6c26dd25466154c49fadb7b3449bd7"
103
103
  }
@@ -1,4 +1,4 @@
1
- import { fireEvent } from "@testing-library/react";
1
+ import { act, fireEvent, screen } from "@testing-library/react";
2
2
  import { render } from "@truedat/test/render";
3
3
  import LineageGroupNode from "../graph/LineageGroupNode";
4
4
  import { EdgeHoverContext } from "../graph/ColoredEdge";
@@ -198,22 +198,24 @@ describe("<LineageGroupNode />", () => {
198
198
  ).toBeInTheDocument();
199
199
  });
200
200
 
201
- it("renders the oversized warning title band and message", () => {
202
- const rendered = render(
203
- <LineageGroupNode
204
- id="oversized-group"
205
- data={{
206
- designVariant: "redesigned",
207
- label: "Oversized group",
208
- oversized: true,
209
- oversizedWarningOpen: true,
210
- variant: "absolute",
211
- }}
212
- />,
213
- );
201
+ it("renders the oversized warning title band and message", async () => {
202
+ await act(async () => {
203
+ render(
204
+ <LineageGroupNode
205
+ id="oversized-group"
206
+ data={{
207
+ designVariant: "redesigned",
208
+ label: "Oversized group",
209
+ oversized: true,
210
+ oversizedWarningOpen: true,
211
+ variant: "absolute",
212
+ }}
213
+ />,
214
+ );
215
+ });
214
216
 
215
- expect(rendered.getByText("Warning")).toBeInTheDocument();
216
- expect(rendered.getByText(/more than 20 nodes/)).toBeInTheDocument();
217
+ expect(screen.getByText("Warning")).toBeInTheDocument();
218
+ expect(screen.getByText(/more than 20 nodes/)).toBeInTheDocument();
217
219
  });
218
220
 
219
221
  it("omits the oversized badge for regular groups", () => {
@@ -235,23 +237,25 @@ describe("<LineageGroupNode />", () => {
235
237
  ).not.toBeInTheDocument();
236
238
  });
237
239
 
238
- it("offers the Open link when the oversized warning was triggered", () => {
240
+ it("offers the Open link when the oversized warning was triggered", async () => {
239
241
  const onConfirmOversizedExpand = jest.fn();
240
- const rendered = render(
241
- <LineageGroupNode
242
- id="blocked-group"
243
- data={{
244
- designVariant: "redesigned",
245
- label: "Blocked group",
246
- onConfirmOversizedExpand,
247
- oversized: true,
248
- oversizedWarningOpen: true,
249
- variant: "absolute",
250
- }}
251
- />,
252
- );
242
+ await act(async () => {
243
+ render(
244
+ <LineageGroupNode
245
+ id="blocked-group"
246
+ data={{
247
+ designVariant: "redesigned",
248
+ label: "Blocked group",
249
+ onConfirmOversizedExpand,
250
+ oversized: true,
251
+ oversizedWarningOpen: true,
252
+ variant: "absolute",
253
+ }}
254
+ />,
255
+ );
256
+ });
253
257
 
254
- const openButton = rendered.getByRole("button", { name: "Open" });
258
+ const openButton = screen.getByRole("button", { name: "Open" });
255
259
  expect(openButton).toBeInTheDocument();
256
260
  fireEvent.click(openButton);
257
261
  expect(onConfirmOversizedExpand).toHaveBeenCalled();
@@ -1,24 +1,10 @@
1
1
  import { useActiveRoutes } from "../useActiveRoutes";
2
2
 
3
- // Mock the react-router and lodash functions that are used in the hook
3
+ // Mock react-router functions used in the hook
4
4
  jest.mock("react-router", () => ({
5
5
  useLocation: () => ({ pathname: "/test" }),
6
6
  }));
7
7
 
8
- jest.mock("lodash/fp", () => ({
9
- prop: jest.fn((key) => (obj) => obj[key]),
10
- orderBy: jest.fn((iteratees, orders, collection) => collection.sort()),
11
- castArray: jest.fn((val) => (Array.isArray(val) ? val : [val])),
12
- size: jest.fn((val) => (typeof val === "string" ? val.length : 0)),
13
- flow: jest.fn(
14
- (...funcs) =>
15
- (...args) =>
16
- funcs.reduceRight((arg, fn) => fn(arg), args),
17
- ),
18
- map: jest.fn((fn) => (arr) => arr.map(fn)),
19
- head: jest.fn((arr) => arr[0]),
20
- }));
21
-
22
8
  jest.mock("@truedat/core/routes", () => ({
23
9
  BUCKETS_VIEW: "/buckets/:propertyPath",
24
10
  }));
@@ -31,14 +17,6 @@ describe("hooks: useActiveRoutes", () => {
31
17
  beforeEach(() => {
32
18
  jest.clearAllMocks();
33
19
 
34
- // Setup default mocks
35
- require("lodash/fp").prop.mockImplementation((key) => (obj) => obj[key]);
36
- require("lodash/fp").orderBy.mockImplementation(
37
- (iteratees, orders, collection) => collection,
38
- );
39
- require("lodash/fp").castArray.mockImplementation((val) =>
40
- Array.isArray(val) ? val : [val],
41
- );
42
20
  require("react-router").useLocation = () => ({ pathname: "/test" });
43
21
  });
44
22