@truedat/core 8.11.7 → 8.11.9

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.11.7",
3
+ "version": "8.11.9",
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.11.7",
60
+ "@truedat/test": "8.11.9",
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": "ae97c12c9013e8881f997e7e407402fe6b1eff0a"
102
+ "gitHead": "7ecccf4e5e9e4bf052cbe4414ce196751335a235"
103
103
  }
@@ -1,4 +1,4 @@
1
- import { fireEvent, waitFor } from "@testing-library/react";
1
+ import { fireEvent } from "@testing-library/react";
2
2
  import { render } from "@truedat/test/render";
3
3
  import ColoredEdge, {
4
4
  EdgeHoverContext,
@@ -20,93 +20,6 @@ jest.mock("@xyflow/react", () => ({
20
20
  ],
21
21
  }));
22
22
 
23
- describe("<ColoredEdge /> flow animation", () => {
24
- it("uses the measured path length for the motion duration", async () => {
25
- const originalGetTotalLength = SVGElement.prototype.getTotalLength;
26
-
27
- SVGElement.prototype.getTotalLength = jest.fn(() => 400);
28
-
29
- try {
30
- const rendered = render(
31
- <svg>
32
- <ColoredEdge
33
- id="animated-edge"
34
- source="a"
35
- target="b"
36
- sourceX={0}
37
- sourceY={100}
38
- targetX={400}
39
- targetY={100}
40
- sourcePosition="right"
41
- targetPosition="left"
42
- data={{ animated: true, edgePath: "orthogonal" }}
43
- />
44
- </svg>,
45
- );
46
-
47
- await waitFor(() => {
48
- const motion = rendered.container.querySelector("animateMotion");
49
-
50
- expect(motion).not.toBeNull();
51
- expect(motion.getAttribute("dur")).toBe("10s");
52
- expect(motion.getAttribute("calcMode")).toBe("paced");
53
- });
54
- } finally {
55
- if (originalGetTotalLength) {
56
- SVGElement.prototype.getTotalLength = originalGetTotalLength;
57
- } else {
58
- delete SVGElement.prototype.getTotalLength;
59
- }
60
- }
61
- });
62
-
63
- it("keeps the circle immediately visible on very long paths", async () => {
64
- const originalGetTotalLength = SVGElement.prototype.getTotalLength;
65
-
66
- SVGElement.prototype.getTotalLength = jest.fn(() => 4000);
67
-
68
- try {
69
- const rendered = render(
70
- <svg>
71
- <ColoredEdge
72
- id="long-animated-edge"
73
- source="a"
74
- target="b"
75
- sourceX={0}
76
- sourceY={100}
77
- targetX={4000}
78
- targetY={100}
79
- sourcePosition="right"
80
- targetPosition="left"
81
- data={{ animated: true, edgePath: "orthogonal" }}
82
- />
83
- </svg>,
84
- );
85
-
86
- await waitFor(() => {
87
- const circle = rendered.container.querySelector(
88
- ".td-graph-edge-flow-dot",
89
- );
90
-
91
- expect(circle).toHaveAttribute("opacity", "1");
92
- expect(circle.querySelector("animateMotion")).toHaveAttribute(
93
- "dur",
94
- "100s",
95
- );
96
- expect(
97
- circle.querySelector('animate[attributeName="opacity"]'),
98
- ).toBeNull();
99
- });
100
- } finally {
101
- if (originalGetTotalLength) {
102
- SVGElement.prototype.getTotalLength = originalGetTotalLength;
103
- } else {
104
- delete SVGElement.prototype.getTotalLength;
105
- }
106
- }
107
- });
108
- });
109
-
110
23
  describe("<ColoredEdge /> metadata badge", () => {
111
24
  const baseProps = {
112
25
  id: "edge-1",
@@ -80,6 +80,7 @@ describe("<Graph />", () => {
80
80
  };
81
81
 
82
82
  beforeEach(() => {
83
+ jest.useFakeTimers();
83
84
  mockGetNodesBounds.mockReturnValue({ x: 0, y: 0, width: 100, height: 50 });
84
85
  mockGetFlowNodesBounds.mockReturnValue({
85
86
  x: 0,
@@ -96,6 +97,7 @@ describe("<Graph />", () => {
96
97
  });
97
98
 
98
99
  afterEach(() => {
100
+ jest.useRealTimers();
99
101
  mockGetNodesBounds.mockReset();
100
102
  mockGetFlowNodesBounds.mockReset();
101
103
  mockGetViewportForBounds.mockReset();
@@ -34,7 +34,6 @@ const LineageGroupNode = ({ id, data = {} }) => {
34
34
  connectedHandleIds = [],
35
35
  count,
36
36
  designVariant,
37
- hiddenChildrenCount,
38
37
  iconName,
39
38
  isActive,
40
39
  focusDirect,
@@ -59,11 +58,9 @@ const LineageGroupNode = ({ id, data = {} }) => {
59
58
  const connectedHandles = new Set(connectedHandleIds);
60
59
  const connectedHandleClassName = (handleId) =>
61
60
  connectedHandles.has(handleId) ? "td-lineage-node-handle--connected" : "";
62
- const hasHiddenChildren = Number(hiddenChildrenCount) > 0;
63
61
  const hasCollapsedRelations =
64
62
  collapsed && Number(collapsedRelationCounts?.total) > 0;
65
63
  const collapsedRelationsTooltip = relationTooltip(collapsedRelationCounts);
66
- const hiddenChildrenTooltip = `Hidden child nodes: ${hiddenChildrenCount}`;
67
64
  const contentSummary = [
68
65
  nodeCount ? `${nodeCount} ${nodeCount === 1 ? "nodo" : "nodos"}` : "",
69
66
  groupCount ? `${groupCount} ${groupCount === 1 ? "grupo" : "grupos"}` : "",
@@ -239,15 +236,6 @@ const LineageGroupNode = ({ id, data = {} }) => {
239
236
  {collapsedRelationCounts.total}
240
237
  </span>
241
238
  ) : null}
242
- {collapsed && hasHiddenChildren ? (
243
- <span
244
- aria-label={hiddenChildrenTooltip}
245
- className="td-lineage-group-node__collapsed-count"
246
- data-tooltip={hiddenChildrenTooltip}
247
- >
248
- {hiddenChildrenCount}
249
- </span>
250
- ) : null}
251
239
  </>
252
240
  );
253
241
 
@@ -293,7 +281,6 @@ LineageGroupNode.propTypes = {
293
281
  connectedHandleIds: PropTypes.arrayOf(PropTypes.string),
294
282
  count: PropTypes.number,
295
283
  designVariant: PropTypes.oneOf(["classic", "redesigned"]),
296
- hiddenChildrenCount: PropTypes.number,
297
284
  iconName: PropTypes.string,
298
285
  isActive: PropTypes.bool,
299
286
  focusDirect: PropTypes.bool,
@@ -370,7 +370,6 @@
370
370
  width: 30px;
371
371
  }
372
372
 
373
- .td-lineage-group-node__collapsed-count,
374
373
  .td-lineage-group-node__collapsed-relations {
375
374
  position: absolute;
376
375
  right: 14px;
@@ -390,10 +389,6 @@
390
389
  pointer-events: none;
391
390
  }
392
391
 
393
- .td-lineage-group-node__collapsed-count {
394
- bottom: 12px;
395
- }
396
-
397
392
  .td-lineage-group-node__collapsed-relations {
398
393
  bottom: 42px;
399
394
  background: var(--td-graph-accent, #ed5c17);