Skip to content

fix(tests): wait for appended reply before asserting order#40

Merged
tomcasaburi merged 1 commit intomasterfrom
fix/replies-publish-order-wait
Mar 19, 2026
Merged

fix(tests): wait for appended reply before asserting order#40
tomcasaburi merged 1 commit intomasterfrom
fix/replies-publish-order-wait

Conversation

@tomcasaburi
Copy link
Member

@tomcasaburi tomcasaburi commented Mar 19, 2026

Note

Low Risk
Low risk: test-only change that makes an async ordering assertion more deterministic, without affecting production logic.

Overview
Updates src/hooks/replies.test.ts to make the scroll pages append and publish test less flaky by waiting until the appended account reply is present in its expected position (length and cid) before asserting reply ordering.

Written by Cursor Bugbot for commit aeb7e6b. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Tests
    • Improved test reliability for replies handling by replacing timing-based synchronization with deterministic assertions, ensuring more robust test execution.

@tomcasaburi tomcasaburi merged commit 17f73c6 into master Mar 19, 2026
6 of 7 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 59a7a032-1066-45ff-adaf-e62ca52bb0ab

📥 Commits

Reviewing files that changed from the base of the PR and between c88e2a7 and aeb7e6b.

📒 Files selected for processing (1)
  • src/hooks/replies.test.ts

📝 Walkthrough

Walkthrough

The test case for useReplies with accountComments configuration was updated to replace a loose readiness condition based on feed length with a deterministic waitFor assertion that verifies the exact number of replies and validates the presence of a specific appended account reply.

Changes

Cohort / File(s) Summary
Test Synchronization Enhancement
src/hooks/replies.test.ts
Replaced loose timing condition (replies.length > 2) with deterministic waitFor that asserts exactly 3 replies exist and verifies the appended account reply is at index 2, improving test reliability.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A test once loose, now precise and tight,
No more relying on length to get it right,
With waitFor asserting each reply's place,
Our synchronization runs at a steadier pace!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/replies-publish-order-wait
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomcasaburi tomcasaburi deleted the fix/replies-publish-order-wait branch March 19, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant