test(Tasks): Add Recur, Priority, and Reports toggle tests#436
test(Tasks): Add Recur, Priority, and Reports toggle tests#436ShivaGupta-14 wants to merge 1 commit intoCCExtractor:mainfrom
Conversation
|
Thank you for opening this PR! Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools. Please take a moment to:
More information on how to conduct a self review: This helps make the review process smoother and gives us a clearer understanding of your thought process. Once you've added your self-review, we'll continue from our side. Thank you! |
- Add feature-specific tests for editing flows - Move data-testid from SelectTrigger to Select for testability - Update Select mock to support dynamic test-ids - Add ResizeObserver mock
63ea37c to
e78b544
Compare
There was a problem hiding this comment.
Moreover I'd suggest creating separate PRs for Recur, Priority, Reports toggle. And so on. Most tests new or old end up being flaky so we need a better way to sort these out.
Better yet just create a new file for those tests if they are new, for ex:
Tasks.editing.test.tsx
Tasks.priority.test.tsx and similar.
Else if the suite already exists, and need to update anything, do so in the same file. Will break this down later
|
|
||
| test('shows error toast when priority save fails', async () => { | ||
| const { toast } = require('react-toastify'); | ||
| const hooks = require('../hooks'); |
There was a problem hiding this comment.
imo just move this to the top, its being reused a lot
| Select: ({ children, onValueChange, value, ...props }: any) => { | ||
| return ( | ||
| <select | ||
| data-testid="project-select" |
There was a problem hiding this comment.
these data-testid related changes are not really desired.
should be reverted
There was a problem hiding this comment.
please revert these as those spreaded props are kind of vague, and make it hard to read
There was a problem hiding this comment.
yes, i will do that, could you please confirm the structure mentioned above?(for new tests)
|
Moreover got conflicts due to recent merge, needs to be fixed |
Description
Add feature-specific tests for editing flows
Move data-testid from SelectTrigger to Select for testability
Update Select mock to support dynamic test-ids
Add ResizeObserver mock
Tracking: Tracking Issue: Tasks Component Test Improvements #433
Checklist
npx prettier --write .(for formatting)gofmt -w .(for Go backend)npm test(for JS/TS testing)Additional Notes
Before:
After: