test: re-work some brittle atproto mocks#2798
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThree test files refactor how they control ChangesuseAtproto mock refactoring across component and composable tests
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Stop mocking `useAtproto` in a few tests and instead set the shared composable state that the app reads at runtime. These tests were brittle because the mocked binding could diverge from the import path used by the component or composable under test, suddenly quietly shifting the exercised state from under us, leading to difficult to debug failures.
e5535a9 to
2163103
Compare
🔗 Linked issue
N/A
🧭 Context
I dunno, these started failing on a completely unrelated branch and simplifying them like this fixed it 😅.
📚 Description
Stop mocking
useAtprotoin a few tests and instead just set the composable state directly. These tests were brittle because the untyped mock could diverge from the actual use in the component/composable under test, suddenly quietly shifting the exercised state from under us, leading to difficult to debug failures like the one I encountered.