Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/e2e/inspector-dock-layout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,18 @@ test.describe('docked right-inspector dock-aware width (#586 findings 2a/2b)', (
expect(Math.round(before.width)).toBe(500);

await page.setViewportSize({ width: 900, height: 800 });
// #599: `setViewportSize` resolves as soon as the viewport is applied, but
// the DISPLAYED width above is recomputed by app-shell.ts's
// `reclampInspectorWidth`, run from a real `window` 'resize' event
// LISTENER — dispatched asynchronously relative to that resolution, and
// more likely to lose the race under parallel load. Poll for the settled
// width instead of reading it on the very next microtask.
await expect.poll(async () => Math.round((await inspectorHost.boundingBox()).width))
// Default sidebarPx (248) + 2 handles (14) reserved, minus CENTRE_MIN_PX
// (320): ceiling = 900-262-320 = 318, below the shared 320 floor — clamp
// floors it at 320 exactly.
.toBe(320);
const after = await inspectorHost.boundingBox();
// Default sidebarPx (248) + 2 handles (14) reserved, minus CENTRE_MIN_PX
// (320): ceiling = 900-262-320 = 318, below the shared 320 floor — clamp
// floors it at 320 exactly.
expect(Math.round(after.width)).toBe(320);
expect(after.width).toBeLessThan(before.width);

test.info().annotations.push(
Expand Down
10 changes: 9 additions & 1 deletion tests/e2e/tile-open-workbench.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,15 @@ test('widen doubles a grid tile\'s rendered width, preserves its height, then wr
// until #564.
expect(wide.width).toBeGreaterThan(before.width);
expect(wide.height).toBe(before.height);
expect((await page.evaluate(() => window.__dashboard('sales'))).items['t-sales'])
// #599: the widen press applies OPTIMISTICALLY first (`runCommand`,
// src/ui/dashboard.ts) — the geometry above is already settled by the time
// `widen.click()` resolves, but the PERSISTED commit this reads is a
// separate, fire-and-forget `app.mutateWorkspace` call that lands later.
// Poll rather than reading it on the very next microtask, matching the same
// commit-republish race the later "narrow tile" test already guards
// against (its own "Read defensively" comment, below).
await expect.poll(async () => (await page.evaluate(() => window.__dashboard('sales')))
?.items?.['t-sales'] ?? null)
.toEqual({ grid: { span: 12, height: 2 } });

// At the maximum the next press wraps to a single column.
Expand Down