Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

Description

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Before:

Screenshot 2026-01-22 at 1 33 20 AM

After:

Screenshot 2026-01-24 at 5 52 43 PM

@github-actions
Copy link

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:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

More information on how to conduct a self review:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

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
@ShivaGupta-14 ShivaGupta-14 force-pushed the test/300-tasks-recur-priority-reports branch from 63ea37c to e78b544 Compare January 24, 2026 13:06
Copy link
Collaborator

@its-me-abhishek its-me-abhishek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo just move this to the top, its being reused a lot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will

test('saving "NONE" priority sends empty string to backend', async () => {
render(<Tasks {...mockProps} />);

await screen.findByText('Task 12');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have too many tests, some are vague as well, and it will be even more hard to distinguish later.
Do move blocks like these to separate functions

await screen.findByText('Task 12');
fireEvent.click(screen.getByText('Task 12'));
expect(await screen.findByText('Priority:')).toBeInTheDocument();

Copy link
Contributor Author

@ShivaGupta-14 ShivaGupta-14 Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it! is this good structure, should i proceed with this

frontend/src/components/HomeComponents/Tasks/
├── __tests__/
   ├── setup.ts       ->  mocks
   ├── helpers.ts     ->  shared utilities
   ├── Tasks.test.tsx
   ├── Tasks.keyboard.test.tsx
   ├── Tasks.priority.test.tsx
   ├── Tasks.recur.test.tsx
   ├── Tasks.reports.test.tsx
   ├── Tasks.annotations.test.tsx

I'll extract repeated code (like opening task dialog) into helpers.ts.

  • Also, could you point out which tests you found vague? I'd like to improve those

Select: ({ children, onValueChange, value, ...props }: any) => {
return (
<select
data-testid="project-select"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these data-testid related changes are not really desired.
should be reverted

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.

2 participants