Skip to content

Commit b0415d2

Browse files
committed
fix(e2e): update resize tests for new autoResize semantics
- Add explicit height (400px) to Auto Resize test container (autoResize now requires container dimensions) - Update test descriptions to reflect 0px chart in unconstrained containers - Update infinite growth test doc to describe new expected behavior
1 parent b869083 commit b0415d2

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

apps/e2e/__tests__/resize-infinite-growth.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import { expect, test } from "@playwright/test";
77
* height constraint, a feedback loop occurred causing infinite height growth.
88
*
99
* The fix uses `flex: 1 1 0` with `min-height: 0` on the chart container, which
10-
* prevents the chart from forcing parent height growth while still filling
11-
* available space.
12-
*
13-
* Both constrained and unconstrained containers should now maintain stable heights.
10+
* prevents the chart from forcing parent height growth. In unconstrained containers,
11+
* the chart renders at 0px height (the child content still contributes height).
12+
* In constrained containers, the chart fills the available space correctly.
1413
*/
1514
test.describe("Infinite Height Growth Bug (Fixed)", () => {
1615
test.beforeEach(async ({ page }) => {

apps/e2e/pages/Resize.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ export const Resize: Component = () => {
9494
<div>
9595
<h3 class="mb-2 text-lg font-medium">Auto Resize (ResizeObserver)</h3>
9696
<p class="mb-3 text-sm text-gray-600">
97-
Verifies chart fills its container via ResizeObserver and responds to viewport
98-
changes.
97+
Verifies chart fills its sized container (400px height) via ResizeObserver and
98+
responds to viewport changes.
9999
</p>
100-
<div class="border-2 border-dashed border-blue-300 p-4">
100+
<div class="border-2 border-dashed border-blue-300 p-4" style={{ height: "400px" }}>
101101
<SolidUplot
102102
data={data()}
103103
autoResize
@@ -227,8 +227,8 @@ export const Resize: Component = () => {
227227
<div class="rounded-lg border border-gray-200 bg-white p-6">
228228
<h2 class="mb-2 text-xl font-semibold">Auto Resize Constraints</h2>
229229
<p class="mb-4 text-sm text-gray-600">
230-
Tests autoResize behavior under different container constraints — with and without
231-
explicit height.
230+
Tests autoResize behavior under different container constraints. Unconstrained containers
231+
result in a 0px chart (with a dev warning), while constrained containers fill correctly.
232232
</p>
233233

234234
<div class="space-y-6">
@@ -237,7 +237,8 @@ export const Resize: Component = () => {
237237
<h3 class="mb-2 text-lg font-semibold text-blue-700">Unconstrained Container</h3>
238238
<p class="mb-3 text-sm text-gray-600">
239239
Verifies autoResize in a container with no explicit height does not cause infinite
240-
growth.
240+
growth. The chart renders at 0px height (expected) while the child content remains
241+
visible.
241242
</p>
242243
<div data-testid="unconstrained-container">
243244
<SolidUplot

0 commit comments

Comments
 (0)