Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit Tests for Refactored TaskDetails Subcomponents #1245

Merged
merged 42 commits into from
Sep 3, 2024

Conversation

Achintya-Chatterjee
Copy link
Member

@Achintya-Chatterjee Achintya-Chatterjee commented Aug 29, 2024

Date: 29 August, 2024

Developer Name: @Achintya-Chatterjee


Issue Ticket Number

Description

This PR adds comprehensive unit tests for the newly refactored subcomponents of the TaskDetails component. These tests ensure the correct functionality of each subcomponent and maintain the overall integrity of the TaskDetails feature after its modularization.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1

Test Coverage

Screenshot 1 Screenshot 2024-08-29 at 23 26 50 Screenshot 2024-08-29 at 23 31 43 Screenshot 2024-08-30 at 01 53 48 Screenshot 2024-08-30 at 03 20 46 Screenshot 2024-08-30 at 19 11 54 Screenshot 2024-09-02 at 01 39 52 Screenshot 2024-09-02 at 01 38 55

Additional Notes

These tests focus on ensuring that the refactoring of the TaskDetails component into smaller subcomponents has not introduced any regressions. The tests have been executed and confirmed to pass successfully, providing confidence in the refactored code's stability.

…for improved maintainability and performance

- Broke down TaskDetails component into smaller, focused subcomponents: TaskHeader, TaskDescription, TaskDetailsSection, TaskParticipants, TaskDates, TaskDependencies, and TaskProgress.
- Maintained consistent styling using existing CSS classes from task-details.module.scss.
- Ensured all functionalities, including editing, API integration, and state management, remain intact.
- Added performance optimizations using React best practices, such as useCallback and useMemo where applicable.
- Handled loading and error states, as well as edge cases like empty data gracefully.
…nal rendering

- Resolved type issues, ensuring  is correctly handled as a number.
- Fixed conditional rendering to prevent the edit button from appearing for unauthorized users.
- Ensured consistent date formatting using  utility.
- Improved type safety across the TaskDetails subcomponents to prevent future issues.
- Maintained all functionality from previous refactor, including state management and API integration.
- Adjusted the position of the 'Status' and 'Link' fields within the TaskDetailsSection component to ensure they are displayed correctly.
- Ensured that the 'Status' dropdown is only visible in edit mode and does not appear twice.
- Verified that the layout matches the design specifications when switching between view and edit modes.
…onents

- Reverted changes in the component structure that affected the layout and styling.
- Ensured the CSS classes are applied correctly and match the pre-refactor styling.
- Adjusted the JSX structure to maintain the original visual layout.
@Achintya-Chatterjee Achintya-Chatterjee self-assigned this Aug 29, 2024
Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
status-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 3, 2024 0:06am

@Achintya-Chatterjee Achintya-Chatterjee changed the title Add Unit Tests for Refactored TaskDetails Subcomponents Add Unit Tests for Refactored TaskDetails Subcomponents Aug 29, 2024
…already used them in underlying taskdetails component
…already used them in underlying taskdetails component
ashifkhn
ashifkhn previously approved these changes Sep 3, 2024
Base automatically changed from feature/refactor-taskdetails-component to develop September 3, 2024 12:04
@iamitprakash iamitprakash dismissed stale reviews from ashifkhn, tejaskh3, and themself September 3, 2024 12:04

The base branch was changed.

@iamitprakash iamitprakash merged commit 933e06d into develop Sep 3, 2024
2 of 3 checks passed
@iamitprakash iamitprakash deleted the test/refactor-taskdetails-component branch September 3, 2024 12:05
@Achintya-Chatterjee Achintya-Chatterjee mentioned this pull request Sep 3, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write Unit Tests for Refactored TaskDetails Subcomponents
4 participants