Skip to content

Commit

Permalink
Increase coverage a bit more with ui_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosNihelton committed Mar 12, 2024
1 parent f970454 commit d492c0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions windows-agent/internal/proservices/ui/ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ func TestApplyLandscapeConfig(t *testing.T) {
testCases := map[string]struct {
setUserLandscapeConfigErr bool
landscapeSource config.Source
returnBadSource bool

wantErr bool
want interface{}
Expand All @@ -252,6 +253,7 @@ func TestApplyLandscapeConfig(t *testing.T) {

"Error when setting the config returns error": {setUserLandscapeConfigErr: true, wantErr: true},
"Error when attempting to override org config": {landscapeSource: config.SourceRegistry, wantErr: true},
"Error when Landscape source is incoherent": {returnBadSource: true, wantErr: true},
}

for name, tc := range testCases {
Expand All @@ -270,6 +272,7 @@ func TestApplyLandscapeConfig(t *testing.T) {
conf := &mockConfig{
setUserLandscapeConfigErr: tc.setUserLandscapeConfigErr,
landscapeSource: tc.landscapeSource,
returnBadSource: tc.returnBadSource,
}

uiService := ui.New(context.Background(), conf, db)
Expand Down

0 comments on commit d492c0f

Please sign in to comment.