mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-21 20:28:24 +08: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);
|
const snap = await handleMetaCommand('snapshot', ['-i'], bm, shutdown);
|
||||||
// Find a @c ref for Alice
|
// Find a @c ref for Alice
|
||||||
const aliceLine = snap.split('\n').find(l => l.includes('@c') && l.includes('Alice'));
|
const aliceLine = snap.split('\n').find(l => l.includes('@c') && l.includes('Alice'));
|
||||||
if (aliceLine) {
|
expect(aliceLine).toBeTruthy();
|
||||||
const refMatch = aliceLine.match(/@(c\d+)/);
|
const refMatch = aliceLine!.match(/@(c\d+)/);
|
||||||
if (refMatch) {
|
expect(refMatch).toBeTruthy();
|
||||||
const result = await handleWriteCommand('click', [`@${refMatch[1]}`], bm);
|
const result = await handleWriteCommand('click', [`@${refMatch![1]}`], bm);
|
||||||
expect(result).toContain('Clicked');
|
expect(result).toContain('Clicked');
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('snapshot -C still works standalone without -i', async () => {
|
test('snapshot -C still works standalone without -i', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user