Skip to content

[co-3778] refactor: unified advanced filter modals tests#1245

Draft
FrancescoGottardi wants to merge 1 commit into
develfrom
co-3778-advanced-filter-modal-tests
Draft

[co-3778] refactor: unified advanced filter modals tests#1245
FrancescoGottardi wants to merge 1 commit into
develfrom
co-3778-advanced-filter-modal-tests

Conversation

@FrancescoGottardi
Copy link
Copy Markdown
Contributor

No description provided.

@sonarqube-zextras
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors and consolidates the AdvancedFilterModal test suite, removing the previous split “pt2” test file and simplifying test utilities to rely on the modal’s internal react-hook-form setup.

Changes:

  • Simplified shared test utilities by removing the custom FormProvider/useForm wrapper and related default-values helpers.
  • Consolidated and reorganized AdvancedFilterModal tests into clearer describe blocks with parameterized cases.
  • Deleted advanced-filter-modal-pt2.test.tsx after migrating its coverage into the main test file.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/views/search/test/test-advanced-filter-modal-common-utils.tsx Removed obsolete form-wrapper utilities; kept only defaultProps.
src/views/search/test/advanced-filter-modal.test.tsx Unified/restructured modal tests; added useContactInput mocking and migrated pt2 assertions.
src/views/search/test/advanced-filter-modal-pt2.test.tsx Removed redundant split test file after consolidation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +475 to +486
await user.click(screen.getByRole('button', { name: /action\.search/i }));
expect(onSearchConfirm).toHaveBeenCalledWith(
expect.objectContaining({ includeSharedFolders: true })
);
rerender(<AdvancedFilterModal {...props} />);
await waitFor(() => {
expect(
within(screen.getByTestId('isSharedFolderIncludedToggle')).getByTestId(
'icon: ToggleRight'
)
).toBeInTheDocument();
});
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