-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix(cli): other tui update tests #8987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Keep this PR in a mergeable state → Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
Documentation UpdatesAdded documentation for test helper functions that were introduced or consolidated in this PR:
These changes keep the test documentation in sync with the codebase improvements made in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 issues found across 4 files
Prompt for AI agents (all 4 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="extensions/cli/src/ui/__tests__/TUIChat.fileSearch.test.tsx">
<violation number="1" location="extensions/cli/src/ui/__tests__/TUIChat.fileSearch.test.tsx:39">
P2: `waitForCondition` is async but this call never awaits it, so the test continues to assert against the stale frame before the UI updates.</violation>
<violation number="2" location="extensions/cli/src/ui/__tests__/TUIChat.fileSearch.test.tsx:63">
P2: The wait for `@@test` happens after `const frame = lastFrame();`, so the assertions continue to use the pre-wait frame and never see the updated output.</violation>
</file>
<file name="extensions/cli/src/ui/__tests__/TUIChat.slashCommands.test.tsx">
<violation number="1" location="extensions/cli/src/ui/__tests__/TUIChat.slashCommands.test.tsx:34">
P2: `waitForCondition` is asynchronous but is invoked without `await`, so the test continues asserting before the UI updates and stays flaky.</violation>
</file>
<file name="extensions/cli/src/ui/__tests__/TUIChat.testHelper.ts">
<violation number="1" location="extensions/cli/src/ui/__tests__/TUIChat.testHelper.ts:474">
P2: waitForCondition never throws when the timeout elapses, so tests continue even if the condition is never met. Throw an error after the loop so unmet conditions actually fail the test.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
RomneyDa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
There are some other tests which are causing the macos tests to fail because tui is not updated. This PR fixes that
This is a follow-up on #8909
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Stabilizes CLI TUI tests by centralizing a waitForCondition helper and updating tests to use it, fixing macOS failures caused by UI timing.
Written for commit 3db6091. Summary will update automatically on new commits.