From d492c0ff8b8b0f1e1038ce82018e0f0d3ba9c8c0 Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 12 Mar 2024 10:15:35 -0300 Subject: [PATCH] Increase coverage a bit more with ui_test.go --- windows-agent/internal/proservices/ui/ui_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/windows-agent/internal/proservices/ui/ui_test.go b/windows-agent/internal/proservices/ui/ui_test.go index 1b98f4590..6cd48f3a6 100644 --- a/windows-agent/internal/proservices/ui/ui_test.go +++ b/windows-agent/internal/proservices/ui/ui_test.go @@ -244,6 +244,7 @@ func TestApplyLandscapeConfig(t *testing.T) { testCases := map[string]struct { setUserLandscapeConfigErr bool landscapeSource config.Source + returnBadSource bool wantErr bool want interface{} @@ -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 { @@ -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)