- Remove the xterm pointer-events override from dashboard styles to allow terminal text input focus and typing - Add a terminal input CSS contract test to guard against regressions in xterm helper element interactivity - Add a patch changeset for @gsxdsm/fusion documenting the terminal text input fix
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { readFileSync } from "fs";
|
|
import { resolve } from "path";
|
|
|
|
const css = readFileSync(resolve(__dirname, "../styles.css"), "utf-8");
|
|
|
|
function findHelperTextareaRule(): string {
|
|
const match = css.match(
|
|
/\.terminal-xterm\s+\.xterm\s+\.xterm-helper-textarea\s*\{([^}]*)\}/,
|
|
);
|
|
return match?.[1] ?? "";
|
|
}
|
|
|
|
describe("terminal helper textarea CSS contract", () => {
|
|
it("defines the xterm helper textarea rule", () => {
|
|
const ruleBody = findHelperTextareaRule();
|
|
expect(ruleBody).not.toBe("");
|
|
});
|
|
|
|
it("keeps mobile-friendly helper textarea dimensions", () => {
|
|
const ruleBody = findHelperTextareaRule();
|
|
expect(ruleBody).toMatch(/width:\s*1px\b/);
|
|
expect(ruleBody).toMatch(/height:\s*1px\b/);
|
|
});
|
|
|
|
it("does not disable pointer events on the helper textarea", () => {
|
|
const ruleBody = findHelperTextareaRule();
|
|
expect(ruleBody).not.toMatch(/pointer-events\s*:\s*none\b/);
|
|
});
|
|
|
|
it("positions the helper textarea off-screen", () => {
|
|
const ruleBody = findHelperTextareaRule();
|
|
expect(ruleBody).toMatch(/top:\s*-9999px\b/);
|
|
});
|
|
|
|
it("keeps the helper textarea invisible", () => {
|
|
const ruleBody = findHelperTextareaRule();
|
|
expect(ruleBody).toMatch(/opacity:\s*0\b/);
|
|
});
|
|
});
|