Skip to content

Commit

Permalink
#4 add test for MarkInvalid
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-dammeier committed Dec 14, 2023
1 parent c39c6e5 commit 4e38dfc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/domain/blueprintSpec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,19 @@ func Test_BlueprintSpec_CalculateEffectiveBlueprint_changeDoguNamespaceWithFlag(
require.Equal(t, 1, len(spec.EffectiveBlueprint.Dogus), "effective blueprint should contain the elements from the mask")
assert.Equal(t, Dogu{Namespace: "premium", Name: "dogu1", Version: version3_2_1_1, TargetState: TargetStatePresent}, spec.EffectiveBlueprint.Dogus[0])
}

func TestBlueprintSpec_MarkInvalid(t *testing.T) {
spec := BlueprintSpec{
Config: BlueprintConfiguration{AllowDoguNamespaceSwitch: true},
Status: StatusPhaseValidated,
}
expectedErr := &InvalidBlueprintError{
WrappedError: nil,
Message: "test-error",
}
spec.MarkInvalid(expectedErr)

assert.Equal(t, StatusPhaseInvalid, spec.Status)
require.Equal(t, 1, len(spec.Events))
assert.Equal(t, BlueprintSpecInvalidEvent{ValidationError: expectedErr}, spec.Events[0])
}

0 comments on commit 4e38dfc

Please sign in to comment.