solid-recharts 0.1.0 → 0.2.0
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/LICENSE +24 -0
- package/package.json +6 -5
- package/src/component/Customized.tsx +1 -1
- package/src/state/RechartsReduxContext.tsx +1 -1
- package/src/state/selectors/arrayEqualityCheck.ts +1 -1
- package/src/state/selectors/numberDomainEqualityCheck.ts +1 -1
- package/src/state/store.ts +0 -1
- package/src/util/resolveDefaultProps.tsx +1 -1
- package/src/util/typedDataKey.ts +1 -1
- package/src/util/types.ts +1 -1
- package/test/animation/CSSTransitionAnimate.timing.spec.tsx +1 -1
- package/test/animation/JavascriptAnimate.spec.tsx +1 -1
- package/test/animation/legacyAnimationLengthChange.spec.tsx +1 -1
- package/test/cartesian/Area.animation.spec.tsx +1 -1
- package/test/cartesian/Area.range.spec.tsx +1 -1
- package/test/cartesian/Area.spec.tsx +1 -1
- package/test/cartesian/Area.stacked.render.spec.tsx +1 -1
- package/test/cartesian/Area.typed.spec.tsx +1 -1
- package/test/cartesian/Axis.integration.spec.tsx +1 -1
- package/test/cartesian/Bar/Bar.csstransition.spec.tsx +1 -1
- package/test/cartesian/Bar/Bar.spec.tsx +1 -1
- package/test/cartesian/Bar/Bar.typed.spec.tsx +1 -1
- package/test/cartesian/Bar.animation.spec.tsx +1 -1
- package/test/cartesian/Bar.stackDomain.spec.tsx +1 -1
- package/test/cartesian/Bar.stacked.render.spec.tsx +1 -1
- package/test/cartesian/Bar.zeroDimensionFiltering.spec.tsx +1 -1
- package/test/cartesian/Brush.keyboard.spec.tsx +1 -1
- package/test/cartesian/Brush.panorama.spec.tsx +1 -1
- package/test/cartesian/Brush.props.spec.tsx +1 -1
- package/test/cartesian/Brush.render.spec.tsx +1 -1
- package/test/cartesian/Brush.spec.tsx +1 -1
- package/test/cartesian/Brush.stacked.spec.tsx +1 -1
- package/test/cartesian/CartesianAxis.render.spec.tsx +1 -1
- package/test/cartesian/CartesianAxis.spec.tsx +1 -1
- package/test/cartesian/CartesianGrid.render.spec.tsx +1 -1
- package/test/cartesian/CartesianGrid.spec.tsx +1 -1
- package/test/cartesian/ErrorBar.render.spec.tsx +1 -1
- package/test/cartesian/ErrorBar.spec.tsx +1 -1
- package/test/cartesian/Funnel.animation.spec.tsx +1 -1
- package/test/cartesian/Funnel.spec.tsx +1 -1
- package/test/cartesian/Funnel.typed.spec.tsx +1 -1
- package/test/cartesian/GraphicalItemClipPath.scale-behavior.spec.tsx +1 -1
- package/test/cartesian/Line.animation.spec.tsx +1 -1
- package/test/cartesian/Line.sparseAnimationPath.spec.tsx +1 -1
- package/test/cartesian/Line.spec.tsx +1 -1
- package/test/cartesian/Line.typed.spec.tsx +1 -1
- package/test/cartesian/ReferenceArea.render.spec.tsx +1 -1
- package/test/cartesian/ReferenceArea.spec.tsx +1 -1
- package/test/cartesian/ReferenceArea.typed.spec.tsx +1 -1
- package/test/cartesian/ReferenceDot.render.spec.tsx +1 -1
- package/test/cartesian/ReferenceDot.spec.tsx +1 -1
- package/test/cartesian/ReferenceDot.typed.spec.tsx +1 -1
- package/test/cartesian/ReferenceLine/ReferenceLine.panorama.spec.tsx +1 -1
- package/test/cartesian/ReferenceLine/ReferenceLine.spec.tsx +1 -1
- package/test/cartesian/ReferenceLine/ReferenceLine.typed.spec.tsx +1 -1
- package/test/cartesian/ReferenceLine.render.spec.tsx +1 -1
- package/test/cartesian/Scatter.animation.spec.tsx +1 -1
- package/test/cartesian/Scatter.render.spec.tsx +1 -1
- package/test/cartesian/Scatter.spec.tsx +1 -1
- package/test/cartesian/Scatter.typed.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.barSize.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.brush.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.categorydomain.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.datatypes.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.hide.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.multiaxis.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.numberdomain.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.padding.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.padding_clip.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.state.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.tick.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.timescale.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.typed.spec.tsx +1 -1
- package/test/cartesian/XAxis/XAxis.vertical.spec.tsx +1 -1
- package/test/cartesian/XAxis.tickFormatter.spec.tsx +1 -1
- package/test/cartesian/YAxis/YAxis.7362.derivedDomain.spec.tsx +1 -1
- package/test/cartesian/YAxis/YAxis.interval-zero.spec.tsx +1 -1
- package/test/cartesian/YAxis/YAxis.label.spec.tsx +1 -1
- package/test/cartesian/YAxis/YAxis.spec.tsx +1 -1
- package/test/cartesian/YAxis/YAxis.tick.spec.tsx +1 -1
- package/test/cartesian/YAxis/YAxis.tickFormatter.spec.tsx +1 -1
- package/test/cartesian/YAxis/YAxis.typed.spec.tsx +1 -1
- package/test/cartesian/ZAxis.spec.tsx +1 -1
- package/test/cartesian/ZAxis.typed.spec.tsx +1 -1
- package/test/cartesian/axisLineAndStroke.spec.tsx +1 -1
- package/test/cartesian/miscFeatureGaps.spec.tsx +1 -1
- package/test/chart/AccessibilityLayer.spec.tsx +1 -1
- package/test/chart/AccessibilityScans.spec.tsx +2 -2
- package/test/chart/AreaChart.spec.tsx +1 -1
- package/test/chart/AreaChart.typed.spec.tsx +1 -1
- package/test/chart/BarChart.spec.tsx +1 -1
- package/test/chart/BarChart.typed.spec.tsx +1 -1
- package/test/chart/CategoricalChart.spec.tsx +1 -1
- package/test/chart/ComposedChart.spec.tsx +1 -1
- package/test/chart/ComposedChart.typed.spec.tsx +1 -1
- package/test/chart/FunnelChart.spec.tsx +1 -1
- package/test/chart/FunnelChart.typed.spec.tsx +1 -1
- package/test/chart/LineChart.smoke.spec.tsx +1 -1
- package/test/chart/LineChart.spec.tsx +1 -1
- package/test/chart/LineChart.typed.spec.tsx +1 -1
- package/test/chart/NicheChartTooltip.spec.tsx +1 -1
- package/test/chart/PieChart.spec.tsx +1 -1
- package/test/chart/PieChart.typed.spec.tsx +1 -1
- package/test/chart/RadarChart.spec.tsx +1 -1
- package/test/chart/RadarChart.typed.spec.tsx +1 -1
- package/test/chart/RadialBarChart.spec.tsx +1 -1
- package/test/chart/RadialBarChart.typed.spec.tsx +1 -1
- package/test/chart/RechartsWrapper.spec.tsx +1 -1
- package/test/chart/Sankey.content.spec.tsx +1 -1
- package/test/chart/Sankey.spec.tsx +1 -1
- package/test/chart/ScatterChart.spec.tsx +1 -1
- package/test/chart/ScatterChart.typed.spec.tsx +1 -1
- package/test/chart/SunburstChart.spec.tsx +1 -1
- package/test/chart/Treemap.animation.spec.tsx +1 -1
- package/test/chart/Treemap.spec.tsx +1 -1
- package/test/chart/chartEvents.spec.tsx +1 -1
- package/test/chart/responsive.spec.tsx +1 -1
- package/test/component/Cell.render.spec.tsx +1 -1
- package/test/component/Cell.spec.tsx +1 -1
- package/test/component/Cursor.spec.tsx +1 -1
- package/test/component/DefaultTooltipContent.spec.tsx +1 -1
- package/test/component/Label.render.spec.tsx +1 -1
- package/test/component/Label.spec.tsx +1 -1
- package/test/component/LabelList.spec.tsx +1 -1
- package/test/component/Legend.itemSorter.spec.tsx +1 -1
- package/test/component/Legend.render.spec.tsx +1 -1
- package/test/component/Legend.spec.tsx +1 -1
- package/test/component/ResponsiveContainer.spec.tsx +1 -1
- package/test/component/ResponsiveContainerDataTest.spec.tsx +1 -1
- package/test/component/Text.spec.tsx +1 -1
- package/test/component/Tooltip/ActiveDot.spec.tsx +1 -1
- package/test/component/Tooltip/tooltipEventType.spec.tsx +1 -1
- package/test/component/Tooltip/tooltipTestHelpers.tsx +1 -1
- package/test/component/Tooltip.defaultIndex.spec.tsx +1 -1
- package/test/component/Tooltip.hover.spec.tsx +1 -1
- package/test/component/Tooltip.item.spec.tsx +1 -1
- package/test/component/Tooltip.keyboard.spec.tsx +1 -1
- package/test/component/Tooltip.payload.spec.tsx +1 -1
- package/test/component/Tooltip.touch.spec.tsx +1 -1
- package/test/component/Tooltip.visibility.spec.tsx +1 -1
- package/test/component/TooltipBoundingBox.spec.tsx +2 -2
- package/test/container/ClipPath.spec.tsx +1 -1
- package/test/context/chartLayoutContext.spec.tsx +1 -1
- package/test/helper/createSelectorTestCase.tsx +1 -1
- package/test/helper/selectorTestHelpers.tsx +1 -1
- package/test/hooks/useActiveTooltipDataPoints.spec.tsx +1 -1
- package/test/hooks/useOffset.spec.tsx +1 -1
- package/test/hooks/useTooltipStateHooks.spec.tsx +1 -1
- package/test/polar/Pie/Pie-TwoLevelPieChart.spec.tsx +1 -1
- package/test/polar/Pie/Pie.spec.tsx +1 -1
- package/test/polar/Pie/Pie.typed.spec.tsx +1 -1
- package/test/polar/Pie.animation.spec.tsx +1 -1
- package/test/polar/PieWithLegend.animation.spec.tsx +1 -1
- package/test/polar/PolarAngleAxis/PolarAngleAxis.events.spec.tsx +1 -1
- package/test/polar/PolarAngleAxis/PolarAngleAxis.spec.tsx +1 -1
- package/test/polar/PolarAngleAxis/PolarAngleAxis.typed.spec.tsx +1 -1
- package/test/polar/PolarAngleAxis.render.spec.tsx +1 -1
- package/test/polar/PolarGrid.render.spec.tsx +1 -1
- package/test/polar/PolarGrid.spec.tsx +1 -1
- package/test/polar/PolarLegendPerRow.render.spec.tsx +1 -1
- package/test/polar/PolarRadiusAxis.events.spec.tsx +1 -1
- package/test/polar/PolarRadiusAxis.render.spec.tsx +1 -1
- package/test/polar/PolarRadiusAxis.spec.tsx +1 -1
- package/test/polar/PolarRadiusAxis.typed.spec.tsx +1 -1
- package/test/polar/PolarTooltipLegend.render.spec.tsx +1 -1
- package/test/polar/Radar.animation.spec.tsx +1 -1
- package/test/polar/Radar.render.spec.tsx +1 -1
- package/test/polar/Radar.spec.tsx +1 -1
- package/test/polar/Radar.typed.spec.tsx +1 -1
- package/test/polar/RadialBar/RadialBar.spec.tsx +1 -1
- package/test/polar/RadialBar/RadialBar.typed.spec.tsx +1 -1
- package/test/polar/RadialBar.animation.spec.tsx +1 -1
- package/test/polar/RadialBar.render.spec.tsx +1 -1
- package/test/polar/RadialBar.stacked.spec.tsx +1 -1
- package/test/setup.ts +1 -1
- package/test/shape/ActiveShape.spec.tsx +1 -1
- package/test/shape/Cross.spec.tsx +1 -1
- package/test/shape/Curve.spec.tsx +1 -1
- package/test/shape/Curve.typed.spec.tsx +1 -1
- package/test/shape/Dot.spec.tsx +1 -1
- package/test/shape/Polygon.spec.tsx +1 -1
- package/test/shape/Rectangle.animation.spec.tsx +1 -1
- package/test/shape/Rectangle.spec.tsx +1 -1
- package/test/shape/Sector.spec.tsx +1 -1
- package/test/shape/Symbols.spec.tsx +1 -1
- package/test/shape/Trapezoid.spec.tsx +1 -1
- package/test/state/hooks.spec.tsx +1 -1
- package/test/state/selectors/axisSelectors.spec.tsx +1 -1
- package/test/state/selectors/dataSelectors.spec.tsx +1 -1
- package/test/state/selectors/legendSelectors.spec.tsx +1 -1
- package/test/state/selectors/radarSelectors.spec.tsx +1 -1
- package/test/state/selectors/selectActiveTooltipIndex.spec.tsx +1 -1
- package/test/state/selectors/selectDisplayedData.spec.tsx +1 -1
- package/test/state/selectors/selectStackGroups.spec.tsx +1 -1
- package/test/state/selectors/selectors.spec.tsx +1 -1
- package/test/util/DomUtils.spec.tsx +1 -1
- package/test/util/FunnelUtils.spec.tsx +1 -1
- package/test/util/useElementOffset.spec.tsx +1 -1
- package/test/util/usePrefersReducedMotion.spec.ts +1 -1
- package/test/util/useUniqueId.spec.ts +1 -1
- package/test/zIndex/AllZIndexPortals.spec.tsx +1 -1
- package/test/zIndex/DynamicZIndex.spec.tsx +1 -1
- package/test/zIndex/ZIndexLayer.portalOwner.spec.tsx +1 -1
- package/test/zIndex/componentZIndex.spec.tsx +1 -1
- package/test/zIndex/multiChartZIndexIsolation.spec.tsx +1 -1
- package/NEXT_SESSION_PROMPT.md +0 -114
- package/test/helper/render.ts +0 -7
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// import; the invalid-input cast uses `unknown` instead of `any`. Assertions
|
|
4
4
|
// are byte-identical (snapshots self-record our output; the `.recharts-cross`
|
|
5
5
|
// counts are the parity signal).
|
|
6
|
-
import { render } from "
|
|
6
|
+
import { render } from "@solidjs/testing-library";
|
|
7
7
|
|
|
8
8
|
import { Surface, Cross } from "../../src";
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// render takes a thunk. All assertions are byte-identical.
|
|
5
5
|
import { describe, expect, it, test } from "vitest";
|
|
6
6
|
import { createSignal } from "solid-js";
|
|
7
|
-
import { render, fireEvent } from "
|
|
7
|
+
import { render, fireEvent } from "@solidjs/testing-library";
|
|
8
8
|
import { curveLinear } from "victory-vendor/d3-shape";
|
|
9
9
|
import { Surface, Curve } from "../../src";
|
|
10
10
|
import { getPath, type CurveType } from "../../src/shape/Curve";
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* `(_curveProps, e)` React signature is reported in blocked.)
|
|
20
20
|
*/
|
|
21
21
|
import { describe, it } from "vitest";
|
|
22
|
-
import { render } from "@
|
|
22
|
+
import { render } from "@solidjs/testing-library";
|
|
23
23
|
import { Curve, getRelativeCoordinate } from "../../src";
|
|
24
24
|
|
|
25
25
|
describe("Curve types", () => {
|
package/test/shape/Dot.spec.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Harness changes only: render from local Solid shim, no React import, render takes a thunk.
|
|
3
3
|
// All assertions are byte-identical to recharts.
|
|
4
4
|
import { describe, test, expect } from "vitest";
|
|
5
|
-
import { render } from "
|
|
5
|
+
import { render } from "@solidjs/testing-library";
|
|
6
6
|
|
|
7
7
|
import { Surface, Dot } from "../../src";
|
|
8
8
|
import { assertNotNull } from "../helper/assertNotNull";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Harness changes only: render/fireEvent from the local Solid shim (thunk), no
|
|
3
3
|
// React import; `className` → `class` (the sanctioned prop rename). Path `d`
|
|
4
4
|
// assertions are byte-identical (the parity signal); snapshots self-record.
|
|
5
|
-
import { render, fireEvent } from "
|
|
5
|
+
import { render, fireEvent } from "@solidjs/testing-library";
|
|
6
6
|
import { Surface, Polygon } from "../../src";
|
|
7
7
|
import { Coordinate } from "../../src/util/types";
|
|
8
8
|
import { assertNotNull } from "../helper/assertNotNull";
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
// is preserved.
|
|
38
38
|
import { beforeAll, afterAll, describe, expect, it } from "vitest";
|
|
39
39
|
import { createSignal, flush } from "solid-js";
|
|
40
|
-
import { render } from "
|
|
40
|
+
import { render } from "@solidjs/testing-library";
|
|
41
41
|
import { trim } from "../helper/trim";
|
|
42
42
|
import { assertNotNull } from "../helper/assertNotNull";
|
|
43
43
|
import { Rectangle, Surface } from "../../src";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Harness changes only: render from the local Solid shim (thunk), no React
|
|
3
3
|
// import; invalid-input casts use `unknown`. These all exercise the static
|
|
4
4
|
// (non-update-animation) path. Path `d`/arc assertions are byte-identical.
|
|
5
|
-
import { render } from "
|
|
5
|
+
import { render } from "@solidjs/testing-library";
|
|
6
6
|
import { Surface, Rectangle } from "../../src";
|
|
7
7
|
import { RectRadius } from "../../src/shape/Rectangle";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Harness changes only: render from the local Solid shim (thunk), no React
|
|
3
3
|
// import. Assertions are byte-identical (snapshots self-record; the
|
|
4
4
|
// `.recharts-sector` presence/count + arc-count are the parity signal).
|
|
5
|
-
import { render } from "
|
|
5
|
+
import { render } from "@solidjs/testing-library";
|
|
6
6
|
|
|
7
7
|
import { Surface, Sector } from "../../src";
|
|
8
8
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// tests are ported; the 4th ('Expect no points attribute on path') renders a
|
|
5
5
|
// full LineChart with XAxis/YAxis/Line and is DEFERRED until the chart vertical
|
|
6
6
|
// is ported.
|
|
7
|
-
import { render } from "
|
|
7
|
+
import { render } from "@solidjs/testing-library";
|
|
8
8
|
import { Surface, Symbols } from "../../src";
|
|
9
9
|
|
|
10
10
|
describe("<Symbols />", () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Harness changes only: render from the local Solid shim (thunk), no React
|
|
3
3
|
// import. The 'with animation' case snapshot matches the reference byte-for-byte
|
|
4
4
|
// (the update-animation path renders the t=0 frame with the "0px 1px" dash).
|
|
5
|
-
import { render } from "
|
|
5
|
+
import { render } from "@solidjs/testing-library";
|
|
6
6
|
import { Surface, Trapezoid } from "../../src";
|
|
7
7
|
|
|
8
8
|
describe("<Trapezoid />", () => {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// asserted after `flush()` (Solid batches writes on microtasks).
|
|
15
15
|
import { describe, expect, it } from "vitest";
|
|
16
16
|
import { flush } from "solid-js";
|
|
17
|
-
import { renderHook } from "
|
|
17
|
+
import { renderHook } from "@solidjs/testing-library";
|
|
18
18
|
import { useAppSelector, useAppStore } from "../../src/state/hooks";
|
|
19
19
|
import { RechartsStoreProvider } from "../../src/state/RechartsStoreProvider";
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ import { PageData, misbehavedData } from "../../_data";
|
|
|
40
40
|
import { createSelectorTestCase } from "../../helper/createSelectorTestCase";
|
|
41
41
|
import { expectXAxisTicks } from "../../helper/expectAxisTicks";
|
|
42
42
|
import { expectLastCalledWithScale } from "../../helper/expectScale";
|
|
43
|
-
import { render } from "
|
|
43
|
+
import { render } from "@solidjs/testing-library";
|
|
44
44
|
import { useAppStore } from "../../../src/state/hooks";
|
|
45
45
|
import {
|
|
46
46
|
shouldReturnFromInitialState,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useAppSelectorWithStableTest,
|
|
11
11
|
} from "../../helper/selectorTestHelpers";
|
|
12
12
|
import { expectLastCalledWith } from "../../helper/expectLastCalledWith";
|
|
13
|
-
import { render } from "
|
|
13
|
+
import { render } from "@solidjs/testing-library";
|
|
14
14
|
|
|
15
15
|
// Ported from recharts 3.8.1 test/state/selectors/dataSelectors.spec.tsx.
|
|
16
16
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useAppSelectorWithStableTest,
|
|
15
15
|
} from "../../helper/selectorTestHelpers";
|
|
16
16
|
import { mockGetBoundingClientRect } from "../../helper/mockGetBoundingClientRect";
|
|
17
|
-
import { render } from "
|
|
17
|
+
import { render } from "@solidjs/testing-library";
|
|
18
18
|
|
|
19
19
|
// Ported from recharts 3.8.1 test/state/selectors/legendSelectors.spec.tsx.
|
|
20
20
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// asserts the selector VALUE before/after the click (render-count assertions dropped).
|
|
8
8
|
import { createEffect, createSignal, flush } from "solid-js";
|
|
9
9
|
import { describe, expect, it, vi } from "vitest";
|
|
10
|
-
import { fireEvent, render } from "
|
|
10
|
+
import { fireEvent, render } from "@solidjs/testing-library";
|
|
11
11
|
import { useAppSelectorWithStableTest } from "../../helper/selectorTestHelpers";
|
|
12
12
|
import { RechartsRootState } from "../../../src/state/store";
|
|
13
13
|
import {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { beforeEach, describe, it } from "vitest";
|
|
2
2
|
import { flush } from "solid-js";
|
|
3
|
-
import { fireEvent } from "
|
|
3
|
+
import { fireEvent } from "@solidjs/testing-library";
|
|
4
4
|
import { createSelectorTestCase } from "../../helper/createSelectorTestCase";
|
|
5
5
|
import { RadialBar, RadialBarChart, Tooltip } from "../../../src";
|
|
6
6
|
import { PageData } from "../../_data";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
useAppSelectorWithStableTest,
|
|
17
17
|
} from "../../helper/selectorTestHelpers";
|
|
18
18
|
import { expectLastCalledWith } from "../../helper/expectLastCalledWith";
|
|
19
|
-
import { render } from "
|
|
19
|
+
import { render } from "@solidjs/testing-library";
|
|
20
20
|
|
|
21
21
|
const data1 = [
|
|
22
22
|
{ label: "Iter: 0", x: 211, y: 481, z: 1798 },
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { createSignal, flush } from "solid-js";
|
|
13
13
|
import type { JSX } from "@solidjs/web";
|
|
14
14
|
import { describe, expect, it } from "vitest";
|
|
15
|
-
import { fireEvent } from "
|
|
15
|
+
import { fireEvent } from "@solidjs/testing-library";
|
|
16
16
|
import type { RechartsRootState } from "../../../src/state/store";
|
|
17
17
|
import { selectStackGroups } from "../../../src/state/selectors/axisSelectors";
|
|
18
18
|
import {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Solid-native store actions; tooltip selector exports live in tooltipSelectors.
|
|
4
4
|
import { createEffect, flush } from "solid-js";
|
|
5
5
|
import { describe, expect, it, test, vi } from "vitest";
|
|
6
|
-
import { render } from "
|
|
6
|
+
import { render } from "@solidjs/testing-library";
|
|
7
7
|
import { RechartsStoreProvider } from "../../../src/state/RechartsStoreProvider";
|
|
8
8
|
import { createRechartsStore, type RechartsRootState } from "../../../src/state/store";
|
|
9
9
|
import { arrayTooltipSearcher } from "../../../src/state/optionsSlice";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Ported from recharts 3.8.1 test/util/DomUtils.spec.tsx.
|
|
2
2
|
// Harness changes only: render from the local Solid shim (thunk), no React
|
|
3
3
|
// import. Assertions are byte-identical to recharts.
|
|
4
|
-
import { render } from "
|
|
4
|
+
import { render } from "@solidjs/testing-library";
|
|
5
5
|
import {
|
|
6
6
|
getStringSize,
|
|
7
7
|
clearStringCache,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// <Shape>/<Layer> emits `<g class="recharts-layer recharts-active-shape">`, so
|
|
7
7
|
// `toHaveClass('recharts-active-shape')` (substring-class match) still holds.
|
|
8
8
|
import { describe, expect, it } from "vitest";
|
|
9
|
-
import { render } from "
|
|
9
|
+
import { render } from "@solidjs/testing-library";
|
|
10
10
|
import { FunnelTrapezoid, type FunnelTrapezoidProps } from "../../src/util/FunnelUtils";
|
|
11
11
|
import type { Coordinate, TrapezoidViewBox } from "../../src/util/types";
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// values are byte-identical to recharts.
|
|
8
8
|
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
9
9
|
import { flush } from "solid-js";
|
|
10
|
-
import { renderHook } from "
|
|
10
|
+
import { renderHook } from "@solidjs/testing-library";
|
|
11
11
|
import { useElementOffset } from "../../src/util/useElementOffset";
|
|
12
12
|
import { getMockDomRect } from "../helper/mockGetBoundingClientRect";
|
|
13
13
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// an Accessor, so the value is read via `result()` where React wrote
|
|
4
4
|
// `result.current`. Assertions/mocks are otherwise byte-identical.
|
|
5
5
|
import { test } from "vitest";
|
|
6
|
-
import { renderHook } from "
|
|
6
|
+
import { renderHook } from "@solidjs/testing-library";
|
|
7
7
|
|
|
8
8
|
import { usePrefersReducedMotion } from "../../src/util/usePrefersReducedMotion";
|
|
9
9
|
import { Global } from "../../src/util/Global";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// spec's structure; the stability assertions hold by construction. Assertions
|
|
6
6
|
// are otherwise byte-identical.
|
|
7
7
|
import { describe, it, expect } from "vitest";
|
|
8
|
-
import { renderHook } from "
|
|
8
|
+
import { renderHook } from "@solidjs/testing-library";
|
|
9
9
|
import { useUniqueId } from "../../src/util/useUniqueId";
|
|
10
10
|
import { useIdFallback } from "../../src/util/useId";
|
|
11
11
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// `store.actions.zIndex.registerZIndexPortal(…)` + `flush()`.
|
|
11
11
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
12
12
|
import { flush } from "solid-js";
|
|
13
|
-
import { render } from "
|
|
13
|
+
import { render } from "@solidjs/testing-library";
|
|
14
14
|
import { RechartsStoreContext } from "../../src/state/RechartsStoreContext";
|
|
15
15
|
import { AllZIndexPortals } from "../../src/zIndex/ZIndexPortal";
|
|
16
16
|
import { createRechartsStore, type RechartsStore } from "../../src/state/store";
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { describe, it, expect } from "vitest";
|
|
14
14
|
import { createSignal, flush } from "solid-js";
|
|
15
15
|
import { LineChart, Line, XAxis, YAxis } from "../../src";
|
|
16
|
-
import { fireEvent, render, screen } from "
|
|
16
|
+
import { fireEvent, render, screen } from "@solidjs/testing-library";
|
|
17
17
|
|
|
18
18
|
describe("Dynamic zIndex updates", () => {
|
|
19
19
|
it("should keep the line in the DOM when zIndex changes dynamically", () => {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { describe, expect, it } from "vitest";
|
|
10
10
|
import { createSignal, flush } from "solid-js";
|
|
11
11
|
import type { JSX } from "@solidjs/web";
|
|
12
|
-
import { render, fireEvent } from "
|
|
12
|
+
import { render, fireEvent } from "@solidjs/testing-library";
|
|
13
13
|
import { BarChart, Bar } from "../../src";
|
|
14
14
|
import type { AnimationController } from "../../src";
|
|
15
15
|
import { AnimationControllerProvider } from "../../src/animation/useAnimationController";
|
|
@@ -10,7 +10,7 @@ import { describe, expect, it } from "vitest";
|
|
|
10
10
|
import { createSignal, flush, Show } from "solid-js";
|
|
11
11
|
import { Bar, BarChart, Pie, PieChart } from "../../src";
|
|
12
12
|
import { assertNotNull } from "../helper/assertNotNull";
|
|
13
|
-
import { render } from "
|
|
13
|
+
import { render } from "@solidjs/testing-library";
|
|
14
14
|
|
|
15
15
|
const barData = [
|
|
16
16
|
{ name: "a", uv: 100 },
|
package/NEXT_SESSION_PROMPT.md
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# Session goal: grow the test suite (and fix what it surfaces)
|
|
2
|
-
|
|
3
|
-
You are continuing a faithful port of **recharts 3.8.1 → SolidJS 2.0** living at
|
|
4
|
-
`/Users/thomas/Downloads/solid-recharts/packages/solid-recharts`. The feature port is ~80%
|
|
5
|
-
complete; **test coverage is the gap** — ~1217 cases vs recharts' ~3658 (~33%). Your job this
|
|
6
|
-
session is to **port reference specs into the Solid suite**, and **fix any real port bugs the
|
|
7
|
-
new tests surface**. Quality over volume: every test must be faithful and must pass for the
|
|
8
|
-
right reason.
|
|
9
|
-
|
|
10
|
-
## The reference
|
|
11
|
-
|
|
12
|
-
recharts 3.8.1 source + tests are checked out at:
|
|
13
|
-
|
|
14
|
-
- `/Users/thomas/Documents/Github/recharts-reference/src`
|
|
15
|
-
- `/Users/thomas/Documents/Github/recharts-reference/test`
|
|
16
|
-
|
|
17
|
-
Port the reference spec's _intent and exact assertions_ (golden numbers, geometry, counts),
|
|
18
|
-
adapting only the React→Solid mechanics.
|
|
19
|
-
|
|
20
|
-
## Non-negotiable conventions (these OVERRIDE defaults)
|
|
21
|
-
|
|
22
|
-
1. **Gate after EVERY change**: `vp check --fix` (lint/format/type — must end at _0 errors_;
|
|
23
|
-
10 warnings is the known steady-state baseline) AND `vp test run` (must stay fully green).
|
|
24
|
-
Do NOT use `npx vitest` — use `vp test run <pattern>`.
|
|
25
|
-
2. **No `any`, no `as`, no non-null `!` in src, no `@ts-expect-error`.** The lint is
|
|
26
|
-
type-aware and WILL catch these (it already caught a bad test this project). Use typed
|
|
27
|
-
coercion / helpers instead.
|
|
28
|
-
3. **Faithful porting.** If a feature is genuinely deferred in the port (check the file's
|
|
29
|
-
header comment), don't assert it — write a _subset_ spec mirroring the existing ported
|
|
30
|
-
specs' style, and note in the spec header which reference assertions you omitted and why.
|
|
31
|
-
If the spec fails because the **port has a real bug or missing-but-claimed feature, FIX the
|
|
32
|
-
port** (faithfully to recharts), don't weaken the test.
|
|
33
|
-
4. **Document deviations** in spec/source header comments (the codebase does this consistently
|
|
34
|
-
— match the surrounding style, comment density, and naming).
|
|
35
|
-
|
|
36
|
-
## Solid 2.0 gotchas that WILL bite (all learned the hard way — see memory)
|
|
37
|
-
|
|
38
|
-
- A global guard in `test/setup.ts` **fails any test on a non-allowlisted Solid diagnostic**
|
|
39
|
-
(STRICT_READ_UNTRACKED etc). Common fixes:
|
|
40
|
-
- Don't read a reactive/accessor value directly in `<Show when={...}>` static children —
|
|
41
|
-
use the accessor-child form `<Show when={obj()}>{(v) => ...}</Show>` with a TRUTHY object
|
|
42
|
-
`when`, OR a plain **ternary** in JSX for a captured non-reactive const (a
|
|
43
|
-
`<Show when={capturedConst}>` still trips STRICT_READ).
|
|
44
|
-
- Bake values into `<For>`-item descriptors; don't render recursive hierarchies via
|
|
45
|
-
components that read reactive `props.*`.
|
|
46
|
-
- **`mouseenter`/`mouseleave` do NOT bubble.** Item handlers live on the wrapping node
|
|
47
|
-
`<Layer>` — `fireEvent.mouseEnter` the Layer `g`, not the inner shape.
|
|
48
|
-
- **Bar item-hover tooltip needs `<Tooltip shared={false}>`** (shared tooltips use the
|
|
49
|
-
axis/mouse path, not item-enter).
|
|
50
|
-
- Solid 2.0 **defers propagation to a flush boundary**: after a sync signal set, a memo read
|
|
51
|
-
in the same tick is stale until `flush()`. Tests call `flush()` after render and after
|
|
52
|
-
`fireEvent`. Use local values (not re-read memos) inside event handlers.
|
|
53
|
-
- Test wrappers: use `props.children`, never destructure `{children}` (breaks the store).
|
|
54
|
-
|
|
55
|
-
## Exact commands
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
cd /Users/thomas/Downloads/solid-recharts/packages/solid-recharts
|
|
59
|
-
vp test run <Name> # run one spec (substring match), e.g. vp test run ChartUtils
|
|
60
|
-
vp test run # full suite (currently 1217 passing / 115 files)
|
|
61
|
-
vp check --fix # the gate (0 errors / 10 warnings = clean)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Prioritized worklist (port in this order — fastest/safest first)
|
|
65
|
-
|
|
66
|
-
**Tier 1 — pure-function specs (no DOM, no flake, highest value).** These pin exact numeric
|
|
67
|
-
behavior of code we already ship but barely test. Reference paths under `…/recharts-reference/test/`:
|
|
68
|
-
|
|
69
|
-
- `util/ChartUtils.spec.tsx`, `util/BarUtils.spec.tsx`, `util/DataUtils.spec.ts` (extend ours)
|
|
70
|
-
- `util/round.spec.ts`, `util/isWellBehavedNumber.spec.ts`, `util/getRelativeCoordinate.spec.ts`
|
|
71
|
-
- `util/ChartUtils/{truncateByDomain,getStackedData,getCateCoordinateOfLine}.spec.*`
|
|
72
|
-
- `util/scale/{getNiceTickValues,arithmetic,createCategoricalInverse}.spec.ts`
|
|
73
|
-
- `util/cursor/{getCursorRectangle,getCursorPoints,getRadialCursorPoints}.spec.ts`
|
|
74
|
-
- `util/payload/getUniqPayload.spec.ts`, `util/tooltip/translate.spec.ts`
|
|
75
|
-
- `util/CartesianUtils/{CartesianUtils,rectWithPoints}.spec.ts`, `util/PolarUtils.spec.ts`
|
|
76
|
-
- `util/resolveDefaultProps.spec.tsx` (NB: our port uses Solid `merge`, not resolveDefaultProps
|
|
77
|
-
— adapt or skip with a note), `util/isDomainSpecifiedByUser.spec.ts`, `util/TickUtils.spec.ts`
|
|
78
|
-
- Also untested port units with NO ref-named spec but clearly testable: `src/util/getSliced.ts`,
|
|
79
|
-
`getEveryNth.ts`, `getActiveCoordinate.ts`, `YAxisUtils.ts`, `getRadiusAndStrokeWidthFromDot.ts`,
|
|
80
|
-
`ReduceCSSCalc.ts` — write fresh unit specs from the port's behavior + reference src.
|
|
81
|
-
|
|
82
|
-
**Tier 2 — state selectors (test through the store; medium effort).**
|
|
83
|
-
`state/selectors/*.spec.tsx` — `dataSelectors`, `axisSelectors`, `legendSelectors`,
|
|
84
|
-
`lineSelectors`, `pieSelectors`, `scatterSelectors`, `radialBarSelectors`, `selectChartOffset`,
|
|
85
|
-
`combiners/combineActiveTooltipIndex`. Use the existing `test/helper/render` + store patterns.
|
|
86
|
-
|
|
87
|
-
**Tier 3 — component/integration specs (deepen behavior).**
|
|
88
|
-
`component/{Text,Label,LabelList,Legend,DefaultTooltipContent,Cursor,ResponsiveContainer}.spec.tsx`,
|
|
89
|
-
`cartesian/{Area,Line,Bar/Bar,Scatter,CartesianAxis,CartesianGrid,ErrorBar,Brush}.spec.tsx`,
|
|
90
|
-
`polar/{Pie/Pie,Radar,RadialBar/RadialBar,PolarGrid,PolarAngleAxis,PolarRadiusAxis}.spec.tsx`,
|
|
91
|
-
`chart/{ComposedChart,RadarChart,ScatterChart,CategoricalChart}.spec.tsx`. These are big in the
|
|
92
|
-
reference — port the parity-critical subset and document omissions (the existing `*.spec.tsx`
|
|
93
|
-
headers show the house style).
|
|
94
|
-
|
|
95
|
-
## Working rhythm
|
|
96
|
-
|
|
97
|
-
1. Pick the next worklist item. Read the reference spec + the port's source.
|
|
98
|
-
2. Port the spec into the mirrored path under `test/` (match existing naming/structure).
|
|
99
|
-
3. `vp test run <Name>`. If it fails: decide — port bug (fix src faithfully) vs deferred feature
|
|
100
|
-
(subset the spec + document). Never weaken a test to hide a real gap.
|
|
101
|
-
4. `vp check --fix`. Confirm 0 errors.
|
|
102
|
-
5. Periodically run the full `vp test run` to catch cross-file regressions.
|
|
103
|
-
6. Update `MEMORY.md` + a memory file when you learn something non-obvious or finish a cluster.
|
|
104
|
-
|
|
105
|
-
## Context to load first
|
|
106
|
-
|
|
107
|
-
Read the memory index at
|
|
108
|
-
`/Users/thomas/.claude/projects/-Users-thomas-Downloads-solid-recharts/memory/MEMORY.md` and the
|
|
109
|
-
files it points to (especially `expectclean-or-diagnostics-silent.md`,
|
|
110
|
-
`solid2-reactivity-timing.md`, `root-config-and-lint.md`, `custom-shape-render-props.md`) — they
|
|
111
|
-
encode the gate, the diagnostic guard, and the reactivity rules above.
|
|
112
|
-
|
|
113
|
-
Start with **Tier 1** and report progress in batches (files ported, tests added, any port bugs
|
|
114
|
-
fixed). Keep the suite green the whole way.
|
package/test/helper/render.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Test render helper, backed by the @solid-recharts/testing-library workspace
|
|
2
|
-
// package (a vendored Solid 2.0 port of @solidjs/testing-library — the official
|
|
3
|
-
// 0.8.x still targets Solid 1.x via the removed `solid-js/web` path). Specs
|
|
4
|
-
// import `render`, `cleanup`, and the @testing-library/dom query/event helpers
|
|
5
|
-
// (screen, fireEvent, waitFor, …) from here so there's a single swap point for
|
|
6
|
-
// when the package is published to npm.
|
|
7
|
-
export * from "@solid-recharts/testing-library";
|