test: strengthen clickability test guard assertions

The @c ref clickability test previously used if-guards that would
silently pass when no Alice line was found in the snapshot output.
Both Claude and Codex adversarial review flagged this as a test that
could regress without CI noticing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-05 22:46:46 -07:00
parent 45e5687ac9
commit fdaf90f6e9
+5 -7
View File
@@ -440,13 +440,11 @@ describe('Dropdown/popover detection', () => {
const snap = await handleMetaCommand('snapshot', ['-i'], bm, shutdown);
// Find a @c ref for Alice
const aliceLine = snap.split('\n').find(l => l.includes('@c') && l.includes('Alice'));
if (aliceLine) {
const refMatch = aliceLine.match(/@(c\d+)/);
if (refMatch) {
const result = await handleWriteCommand('click', [`@${refMatch[1]}`], bm);
expect(result).toContain('Clicked');
}
}
expect(aliceLine).toBeTruthy();
const refMatch = aliceLine!.match(/@(c\d+)/);
expect(refMatch).toBeTruthy();
const result = await handleWriteCommand('click', [`@${refMatch![1]}`], bm);
expect(result).toContain('Clicked');
});
test('snapshot -C still works standalone without -i', async () => {