| 1 | import assert from "node:assert/strict"; |
| 2 | import { readFileSync } from "node:fs"; |
| 3 | import { fileURLToPath } from "node:url"; |
| 4 | |
| 5 | const styles = readFileSync(fileURLToPath(new URL("../styles.css", import.meta.url)), "utf8"); |
| 6 | |
| 7 | assert.match( |
| 8 | styles, |
| 9 | /:root\[data-theme-style\] \.sidebar--workbench \.project-tree__topic--active \.project-tree__topic-label\s*\{[^}]*font-weight:\s*500;/s, |
| 10 | "active and inactive workbench topics keep the same font weight", |
| 11 | ); |
| 12 | assert.doesNotMatch( |
| 13 | styles, |
| 14 | /\.sidebar--workbench \.project-tree__topic--active \.project-tree__topic-label\s*\{[^}]*font-weight:\s*700;/s, |
| 15 | "a later workbench rule cannot restore bold active text", |
| 16 | ); |
| 17 | assert.match( |
| 18 | styles, |
| 19 | /\.sidebar--workbench \.project-tree__topic--active \.project-tree__topic-label\s*\{[^}]*font-weight:\s*500;/s, |
| 20 | "the final workbench override also keeps active topics at the normal weight", |
| 21 | ); |
| 22 | assert.match( |
| 23 | styles, |
| 24 | /:root\[data-theme-style\] \.sidebar--workbench \.project-tree__topic\s*\{[^}]*height:\s*34px;/s, |
| 25 | "workbench topic rows keep a fixed height", |
| 26 | ); |
| 27 | assert.match( |
| 28 | styles, |
| 29 | /\.project-tree__group-input\s*\{[^}]*font-size:\s*inherit;/s, |
| 30 | "group rename inputs keep the group title font size", |
| 31 | ); |
| 32 | assert.doesNotMatch( |
| 33 | styles, |
| 34 | /\.project-tree__group-input\s*\{[^}]*font-size:\s*11px;/s, |
| 35 | "group rename inputs cannot restore the old smaller font size", |
| 36 | ); |
| 37 | |
| 38 | console.log(" PASS project tree row stability contract"); |
| 39 |