// A busy button hides its label under the spinner. Run by `npm test`. The label // has to stay in the accessibility tree (`visibility: hidden` and `display: none` // take it out), or a busy button has no name. import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; import { test } from "node:test"; const css = readFileSync( new URL("../../shared/src/button/Button.css", import.meta.url), "utf8", ); test("a busy button's label stays in the accessibility tree", () => { const rule = /\.ui-button-busy \.ui-button-label \{([^}]*)\}/.exec(css); assert.ok(rule, "no rule for the busy label"); assert.match(rule[1], /opacity:\s*0/); assert.doesNotMatch(rule[1], /visibility:\s*hidden|display:\s*none/); });