|
| 1 | +/** |
| 2 | + * Combos page: content above the workspace grid must not push the grid's bottom out of reach. |
| 3 | + * |
| 4 | + * Suggested combos (and their notices) render inside `.combos-workspace-shell-body`, above |
| 5 | + * `.combos-workspace-root`. The grid keeps the body's full height, so with anything above it |
| 6 | + * the grid ends below the viewport. The body used to clip (`overflow: hidden`), leaving the |
| 7 | + * lower detail fields and the Save / Remove bar unreachable (#9101). A sibling rule meant to |
| 8 | + * shrink the grid never matched, because the suggestions are wrapped in a fieldset, and would |
| 9 | + * have squeezed the grid to nothing once "Show all" expanded the list. |
| 10 | + * |
| 11 | + * Source-text assertions; the rendered geometry was measured in Chromium while fixing this. |
| 12 | + */ |
| 13 | +import { expect, test } from "bun:test"; |
| 14 | +import { effectiveDeclaration, withoutComments } from "./helpers/css-declarations"; |
| 15 | + |
| 16 | +const css = withoutComments( |
| 17 | + await Bun.file(new URL("../src/styles-combos-workspace.css", import.meta.url)).text(), |
| 18 | +); |
| 19 | + |
| 20 | +test("the shell body scrolls, so content above the workspace can scroll out of the way", () => { |
| 21 | + expect(effectiveDeclaration(css, ".combos-workspace-shell-body", "overflow-y")).toBe("auto"); |
| 22 | + expect(() => effectiveDeclaration(css, ".combos-workspace-shell-body", "overflow")).toThrow("property not found"); |
| 23 | +}); |
| 24 | + |
| 25 | +test("the workspace grid keeps its full height instead of shrinking under the suggestions", () => { |
| 26 | + expect(effectiveDeclaration(css, ".combos-workspace-shell-body > .combos-workspace-root", "flex")).toBe("0 0 auto"); |
| 27 | + expect(css).not.toMatch(/\.rb-suggest\s*\+\s*\.combos-workspace-root/); |
| 28 | +}); |
0 commit comments