test(company-input-v2): pull api callback from mock call args to avoid CI race#253
test(company-input-v2): pull api callback from mock call args to avoid CI race#253gcutrini wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing as out-of-scope. The flaky-closure pattern in this v4 test is real but not what Sebastian flagged; we can revisit if it actually flakes in CI. |
Same test-stability fix that was applied to the v5 port (PR #250). The original
auto-replaces a free-text commit…test from #246 captures the API callback via a closure variable that gets set inside the mock implementation; the closure is read on the next line, which races against React's effect commit timing. Passes locally, can flake in CI under different timing.Pulling the callback directly from
mock.calls[last][2]makes the test deterministic.