The plan asked for jsdom AND Playwright from the start and only jsdom was ever built. jsdom has no layout engine: getBoundingClientRect answers zeros, container queries never fire, a theme is an attribute rather than a computed cascade. So every claim about POSITION or SIZE in this kit was unchecked, and the unit suite could not have noticed either of these. A popover bounded its height and not its width. `max-height: 60vh` was there from the start; there was no max-inline-size at all, so a long unbroken string -- a file path, a model filename -- made the popover wider than the screen and anchor.js could not save it: it can move a box, not shrink one. Measured at 1436px inside a 1280px viewport, off the right edge in all four corners. A horizontal split could not fit a narrow screen. The first pane carries an inline size and `flex: 0 0 auto`, so it would not shrink, and the page scrolled sideways at 360px -- 407px of content in a 360px viewport. It wraps now, which stacks the panes, rather than a media query: the kit sizes itself from its container and not from the window. Nine layout tests: every overlay corner, an overlay taller than the viewport, both themes resolving every token they use, light actually being lighter than dark, and no horizontal scrollbar at five widths. `npm run test:all` runs both suites. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
// Layout is the half jsdom cannot see.
|
|
//
|
|
// jsdom has no layout engine: getBoundingClientRect returns zeros, container
|
|
// queries never fire, focus rings do not paint, and a theme is just an
|
|
// attribute. Everything in the unit suite is therefore about behaviour, and
|
|
// every claim about POSITION or SIZE is currently unchecked. These run in a
|
|
// real browser against the real dev server, so those claims get checked too.
|
|
//
|
|
// The dev server is ComfyUI's own interpreter serving through core/serve.py, so
|
|
// the extension allowlist and the traversal guard are exercised by looking at
|
|
// the pages as much as by the Python tests.
|
|
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests-layout",
|
|
fullyParallel: true,
|
|
reporter: process.env.CI ? "line" : "list",
|
|
use: {
|
|
baseURL: "http://127.0.0.1:8231",
|
|
trace: "retain-on-failure",
|
|
},
|
|
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
|
webServer: {
|
|
command: "/Users/dex/Documents/ComfyUI/venv/bin/python ../tools/devserver.py 8231",
|
|
url: "http://127.0.0.1:8231/funpack/",
|
|
reuseExistingServer: true,
|
|
timeout: 120_000,
|
|
},
|
|
});
|