mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-05 05:05:08 +02:00
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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user