@pie-lib/graphing-solution-set 4.1.0-beta.8 → 4.1.0-beta.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.
Files changed (34) hide show
  1. package/package.json +3 -3
  2. package/src/__tests__/bg.test.jsx +0 -250
  3. package/src/__tests__/coordinates-label.test.jsx +0 -243
  4. package/src/__tests__/graph-with-controls.test.jsx +0 -184
  5. package/src/__tests__/graph.test.jsx +0 -93
  6. package/src/__tests__/grid-setup.test.jsx +0 -645
  7. package/src/__tests__/grid.test.jsx +0 -23
  8. package/src/__tests__/labels.test.jsx +0 -41
  9. package/src/__tests__/mark-label.test.jsx +0 -66
  10. package/src/__tests__/toggle-bar.test.jsx +0 -106
  11. package/src/__tests__/tool-menu.test.jsx +0 -453
  12. package/src/__tests__/undo-redo.test.jsx +0 -26
  13. package/src/__tests__/use-debounce.test.js +0 -21
  14. package/src/__tests__/utils.js +0 -41
  15. package/src/__tests__/utils.test.js +0 -105
  16. package/src/axis/__tests__/arrow.test.jsx +0 -43
  17. package/src/axis/__tests__/axes.test.jsx +0 -182
  18. package/src/container/__tests__/actions.test.js +0 -105
  19. package/src/container/__tests__/index.test.jsx +0 -227
  20. package/src/container/__tests__/marks.test.js +0 -172
  21. package/src/container/__tests__/middleware.test.js +0 -235
  22. package/src/container/__tests__/reducer.test.js +0 -324
  23. package/src/tools/line/__tests__/component.test.jsx +0 -37
  24. package/src/tools/polygon/__tests__/component.test.jsx +0 -487
  25. package/src/tools/polygon/__tests__/index.test.js +0 -65
  26. package/src/tools/polygon/__tests__/line.test.jsx +0 -23
  27. package/src/tools/polygon/__tests__/polygon.test.jsx +0 -44
  28. package/src/tools/shared/__tests__/arrow-head.test.jsx +0 -33
  29. package/src/tools/shared/line/__tests__/index.test.jsx +0 -553
  30. package/src/tools/shared/line/__tests__/line-path.test.jsx +0 -56
  31. package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +0 -488
  32. package/src/tools/shared/point/__tests__/arrow-point.test.jsx +0 -91
  33. package/src/tools/shared/point/__tests__/arrow.test.jsx +0 -469
  34. package/src/tools/shared/point/__tests__/base-point.test.jsx +0 -87
@@ -1,93 +0,0 @@
1
- import { render } from '@pie-lib/test-utils';
2
- import React from 'react';
3
-
4
- import Graph, { removeBuildingToolIfCurrentToolDiffers } from '../graph';
5
- import { toolsArr } from '../tools';
6
-
7
- // Pure function tests - keep as-is
8
- describe('removeBuildingToolIfCurrentToolDiffers', () => {
9
- let marks = [
10
- {
11
- type: 'point',
12
- x: 2,
13
- y: 2,
14
- label: 'Point',
15
- showLabel: true,
16
- },
17
- {
18
- type: 'line',
19
- from: { x: 0, y: 0 },
20
- label: 'Line',
21
- building: true,
22
- },
23
- ];
24
-
25
- it('keeps all marks if currentTool is the same', () => {
26
- expect(removeBuildingToolIfCurrentToolDiffers({ marks, currentTool: { type: 'line' } })).toEqual(marks);
27
- });
28
-
29
- it('removes building marks if currentTool is different', () => {
30
- expect(removeBuildingToolIfCurrentToolDiffers({ marks, currentTool: { type: 'different' } })).toEqual([marks[0]]);
31
- });
32
- });
33
-
34
- // Note: Instance method tests have been removed. Component behavior should be tested
35
- // through user interactions and integration tests.
36
- describe('Graph', () => {
37
- let onChangeMarks = jest.fn();
38
-
39
- beforeEach(() => {
40
- onChangeMarks.mockClear();
41
- });
42
-
43
- const complete = jest.fn();
44
- const addPoint = jest.fn();
45
- const currentTool = toolsArr[0];
46
- currentTool.complete = complete;
47
- currentTool.addPoint = addPoint;
48
-
49
- const props = {
50
- className: 'className',
51
- onChangeMarks,
52
- tools: toolsArr,
53
- domain: { min: 0, max: 1, step: 1 },
54
- range: { min: 0, max: 1, step: 1 },
55
- size: { width: 400, height: 400 },
56
- currentTool,
57
- };
58
-
59
- const renderComponent = (extras) => {
60
- const properties = {
61
- ...props,
62
- marks: [
63
- {
64
- type: 'point',
65
- x: 2,
66
- y: 2,
67
- label: 'Point',
68
- showLabel: true,
69
- },
70
- {
71
- type: 'line',
72
- from: { x: 0, y: 0 },
73
- label: 'Line',
74
- building: true,
75
- },
76
- ],
77
- ...extras,
78
- };
79
- return render(<Graph {...properties} />);
80
- };
81
-
82
- describe('rendering', () => {
83
- it('renders without crashing', () => {
84
- const { container } = renderComponent();
85
- expect(container.firstChild).toBeInTheDocument();
86
- });
87
-
88
- it('renders SVG graph', () => {
89
- const { container } = renderComponent();
90
- expect(container.querySelector('svg')).toBeInTheDocument();
91
- });
92
- });
93
- });