Skip to content

Commit bb34a57

Browse files
committed
test(desktop): reject duplicate tool scroll caps
1 parent 2a37e85 commit bb34a57

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

desktop/garyx-desktop/src/renderer/src/tool-trace-design.test.mjs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ const css = readFileSync(path.join(rendererDir, 'styles/turn-summary.css'), 'utf
1414
function declarationsFor(selector) {
1515
const stripped = css.replace(/\/\*[\s\S]*?\*\//g, '');
1616
const rulePattern = /([^{}]+)\{([^{}]*)\}/g;
17+
const declarations = [];
1718
let match;
1819
while ((match = rulePattern.exec(stripped)) !== null) {
1920
const selectors = match[1].split(',').map((part) => part.trim());
2021
if (selectors.includes(selector)) {
21-
return match[2]
22-
.split(';')
23-
.map((part) => part.trim())
24-
.filter(Boolean);
22+
declarations.push(
23+
...match[2]
24+
.split(';')
25+
.map((part) => part.trim())
26+
.filter(Boolean),
27+
);
2528
}
2629
}
27-
assert.fail(`missing tool trace rule ${selector}`);
30+
assert.ok(declarations.length > 0, `missing tool trace rule ${selector}`);
31+
return declarations;
2832
}
2933

3034
test('expanded tool activity grows naturally without nested vertical scrolling', () => {
@@ -39,7 +43,9 @@ test('expanded tool activity grows naturally without nested vertical scrolling',
3943
`${selector} must not cap expanded activity height`,
4044
);
4145
assert.ok(
42-
declarations.every((declaration) => !declaration.startsWith('overflow-y:')),
46+
declarations.every(
47+
(declaration) => !declaration.startsWith('overflow') || declaration === 'overflow: visible',
48+
),
4349
`${selector} must not create a nested vertical scroller`,
4450
);
4551
}

0 commit comments

Comments
 (0)