Skip to content

Commit

Permalink
updated test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Disaiah Bennett <[email protected]>
  • Loading branch information
dislbenn committed May 22, 2024
1 parent 6a98a78 commit 3c110a9
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions controllers/discoveredcluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,23 @@ func Test_Reconciler_CreateKlusterletAddonConfig(t *testing.T) {

func Test_Reconciler_CreateManagedCluster(t *testing.T) {
tests := []struct {
name string
nn types.NamespacedName
want bool
name string
clusterType string
nn types.NamespacedName
want bool
}{
{
name: "should create ManagedCluster object",
name: "should create ROSA ManagedCluster object",
clusterType: "ROSA",
nn: types.NamespacedName{
Name: "foo",
Namespace: "bar",
},
want: true,
},
{
name: "should create MCE-HCP ManagedCluster object",
clusterType: "MultiClusterEngineHCP",
nn: types.NamespacedName{
Name: "foo",
Namespace: "bar",
Expand All @@ -286,7 +297,7 @@ func Test_Reconciler_CreateManagedCluster(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mc := r.CreateManagedCluster(tt.nn)
mc := r.CreateManagedCluster(tt.nn, tt.clusterType)

if got := mc.GetName() != tt.nn.Name; got {
t.Errorf("CreateManagedCluster(tt.nn) = want %v, got %v", got, tt.want)
Expand Down

0 comments on commit 3c110a9

Please sign in to comment.