| 1 | import assert from "node:assert/strict"; |
| 2 | import { readFileSync } from "node:fs"; |
| 3 | |
| 4 | const projectTreeSource = readFileSync(new URL("../components/ProjectTree.tsx", import.meta.url), "utf8"); |
| 5 | const styles = readFileSync(new URL("../styles.css", import.meta.url), "utf8"); |
| 6 | |
| 7 | assert.ok( |
| 8 | projectTreeSource.includes('className="project-tree__section-title project-tree__section-title--pinned"'), |
| 9 | "pinned heading uses a non-interactive section-title class", |
| 10 | ); |
| 11 | assert.ok( |
| 12 | !projectTreeSource.includes('className="project-tree__folder" style={{ cursor'), |
| 13 | "pinned heading does not inherit interactive folder hover styles", |
| 14 | ); |
| 15 | assert.ok( |
| 16 | projectTreeSource.includes('className="project-tree__section-title-icon" aria-hidden="true"'), |
| 17 | "pinned heading marks its decorative icon as hidden from assistive technology", |
| 18 | ); |
| 19 | assert.match( |
| 20 | styles, |
| 21 | /\.sidebar--workbench \.project-tree__section-title--pinned,[^{]*\{[^}]*display:\s*flex;[^}]*height:\s*32px;/s, |
| 22 | "pinned heading keeps the folder-aligned layout without folder interaction styles", |
| 23 | ); |
| 24 | |
| 25 | console.log(" PASS project tree pinned heading contract"); |
| 26 |