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 test cases for filters service #312

Merged
merged 8 commits into from
Apr 26, 2024

Conversation

Arif-Khalid
Copy link
Contributor

@Arif-Khalid Arif-Khalid commented Mar 21, 2024

Summary:

Fixes part of #295

Type of change:

  • 🧪 Tests Update

Changes Made:

  • Added test cases for filters service
    • Covered initial behaviour
    • Covered clear filters
    • Covered update filters
    • Covered update preset view
  • In order to reduce the size of the PR, other functionality will be tested for in another PR

Proposed Commit Message:

Filters service does not have associated tests.

Tests for filters service would make the project
more stable.

Let's add test cases for the filters service.

Checklist:

  • I have tested my changes thoroughly.
  • I have created tests for any new code files created in this PR or provided a link to a issue/PR that addresses this.
  • I have added or modified code comments to improve code readability where necessary.
  • I have updated the project's documentation as necessary.

@Arif-Khalid
Copy link
Contributor Author

To be worked on after finalization of #310 as it makes significant changes to filters service.

@Arif-Khalid Arif-Khalid marked this pull request as ready for review April 23, 2024 10:50
@Arif-Khalid Arif-Khalid requested a review from NereusWB922 April 23, 2024 10:54
@@ -145,6 +145,7 @@ export class FiltersService {
}

clearFilters(): void {
this.updateFilters(this.defaultFilter);
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reasoning for adding this line? Isn't this already covered under the call to updatePresetView?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the most recent change to filters service, the preset view does not contain all filters anymore. Specifically in the current implementation, it excludes hiddenLabels. This ensures that the hidden labels filter and any future filter that is not bound to preset views are properly reset.

@Arif-Khalid Arif-Khalid requested a review from nknguyenhc April 24, 2024 11:46
Copy link
Contributor

@NereusWB922 NereusWB922 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Arif-Khalid Arif-Khalid merged commit 468bc8f into CATcher-org:main Apr 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants