Skip to content

Commit 6bdc43d

Browse files
committed
Increase the test coverage for consoleui/openshift
Bring it up to 100% coverage. Signed-off-by: Chmouel Boudjnah <[email protected]>
1 parent ad1ecec commit 6bdc43d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/consoleui/openshift_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,20 @@ func TestOpenshiftConsoleUI(t *testing.T) {
6060
unsf *unstructured.Unstructured
6161
wantErr bool
6262
wantHost string
63+
wantName string
6364
}{
6465
{
6566
name: "Get Openshift Console url",
6667
unsf: fakeroute,
6768
wantErr: false,
6869
wantHost: "http://fakeconsole",
6970
},
71+
{
72+
name: "Get Openshift Console name",
73+
unsf: fakeroute,
74+
wantErr: false,
75+
wantName: "OpenShift Console",
76+
},
7077
{
7178
name: "No Openshift Console",
7279
unsf: emptys,
@@ -96,6 +103,11 @@ func TestOpenshiftConsoleUI(t *testing.T) {
96103
t.Fatalf("UI() host = %v, want %v", o.host, tt.wantHost)
97104
}
98105
}
106+
if tt.wantName != "" {
107+
if o.GetName() != tt.wantName {
108+
t.Fatalf("UI() name = %v, want %v", o.GetName(), tt.wantName)
109+
}
110+
}
99111
})
100112
}
101113
}

0 commit comments

Comments
 (0)