This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
chore(test): add tests for stepsService & Kaoto UI API #1635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds unit tests for all the remaining methods in
stepsService
, with some caveats.Changes
deleteBranch
deleteStep
getStepNested
handleAppendStep
handleDropOnExistingStep
handleInsertStep
handlePrependStep
replacePlaceholderStep
updateStepParameters
updateViews
createKaotoApi
and tests for its methods:deleteStep
getDeployment
getIntegrationSource
notifyKaoto
startDeployment
step
stepParams
stopDeployment
updateStep
updateStepParams
findStepIdxWithUUID
test to cover cases where we don't pass an array ofsteps
handleDropOnExistingStep
)integrationJson
store before each test as a workaround to an issue with mocking Zundo (see below)Caveat
Execution paths for nested steps are still not covered as there were some issues with nested calls to other Zustand stores, seemingly related to Zundo--paths that call
nestedStepsStore
from a secondary function were very difficult to mock. I'll update these once we get a workaround. cc @lordripTest Coverage
Current coverage of
services
andstepsService
:Expected coverage of
services
andstepsService
:Coverage is not 100% due to the issue with
nestedStepsStore
and Zundo, described above.