Files
speaking-practice/tests/transcript-line-state-colors.test.mjs
T
TTlaji 67dcea21d0
Deploy Speaking Practice / deploy (push) Successful in 2m13s
style: polish responsive typography and transcript states
2026-06-09 22:56:57 +08:00

26 lines
938 B
JavaScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const css = readFileSync(join(__dirname, "..", "styles.css"), "utf8");
assert.match(
css,
/\.line-button\.is-practiced\s*\{[\s\S]*background:\s*#ecfdf3;[\s\S]*border-color:\s*#86efac;[\s\S]*box-shadow:\s*inset 3px 0 0 #16a34a;/,
"practiced transcript rows should use a clear green row highlight",
);
assert.match(
css,
/\.line-button\.is-difficult\s*\{[\s\S]*background:\s*#fffaf0;[\s\S]*box-shadow:\s*inset 3px 0 0 var\(--gold\);/,
"difficult transcript rows should keep the existing gold row highlight",
);
assert.doesNotMatch(
css,
/\.line-status-button\.practiced\.active\s*\{[\s\S]*#16a34a/,
"the stronger practiced color should belong to the transcript row, not the status button",
);