Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

chore(test): add unit tests for all stores #1606

Merged
merged 3 commits into from
Mar 31, 2023

Conversation

kahboom
Copy link
Collaborator

@kahboom kahboom commented Mar 31, 2023

This PR adds unit tests for all Zustand stores, since this was one of the areas with the lowest test coverage.

Changes

  • Add mock for Zustand (relates to Add mocking for testing #1258)
  • Make parameters in stores easier to understand (for example, replaceParentStep instead of replaceStep, or updateViews instead of setViews)
  • Add type to updateIntegration method in visualizationStore

Tasks remaining: Next PR will be focusing on other areas that are also lacking test coverage, such as services and api.

Screenshots

Current code coverage for store (43.13%):

Screen Shot 2023-03-31 at 3 27 29 pm

It should be 100% after this PR is merged.

@kahboom kahboom requested a review from a team March 31, 2023 14:40
chore: Provide a zustand mock

chore(test): remove duplicate zustand mock file

chore(test): add tests for nestedStepsStore

chore(test): add tests for nestedStepsStore

chore(test): add tests for integrationSourceStore

chore(test): add tests for integrationJsonStore
chore(test): add tests for integrationJsonStore
…eViews

chore(test): add tests for visualizationStore

chore(test): add tests for stepCatalogStore

chore(test): add tests for deploymentStore

chore(test): add tests for settingsStore

chore: fix broken unit test
@sonarcloud
Copy link

sonarcloud bot commented Mar 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@igarashitm igarashitm left a comment

Choose a reason for hiding this comment

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

Great work 🎉 will be much easier to add more tests from here, and prevent numerous possibilities of regression in the future 🎉

@kahboom kahboom merged commit d3f0582 into KaotoIO:main Mar 31, 2023
@kahboom kahboom deleted the test-services-store branch March 31, 2023 16:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants