Skip to content

Commit

Permalink
e2e/clusterworkspacetype: add test checking 4 level hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Mar 24, 2022
1 parent df574c9 commit dfa03d6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/e2e/workspacetype/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package workspace
import (
"context"
"fmt"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -101,7 +102,7 @@ func TestClusterWorkspaceTypes(t *testing.T) {
},
},
{
name: "create a workspace with a type that an initializer",
name: "create a workspace with a type that has an initializer",
work: func(ctx context.Context, t *testing.T, server runningServer) {
t.Logf("Create type Foo with an initializer")
_, err := server.orgKcpClient.TenancyV1alpha1().ClusterWorkspaceTypes().Create(ctx, &tenancyv1alpha1.ClusterWorkspaceType{
Expand Down Expand Up @@ -149,6 +150,17 @@ func TestClusterWorkspaceTypes(t *testing.T) {
require.NoError(t, err, "workspace did not become ready")
},
},
{
name: "create a workspace with deeper nesting",
work: func(ctx context.Context, t *testing.T, server runningServer) {
org := framework.NewOrganizationFixture(t, server)
team := framework.NewWorkspaceFixture(t, server, org, "Team")
universal := framework.NewWorkspaceFixture(t, server, team, "Universal")

require.Len(t, strings.Split(universal.String(), ":"), 4, "expecting root:org:team:universal, i.e. 4 levels")
require.True(t, strings.HasPrefix(universal.String(), team.String()), "expecting universal to be a child of team")
},
},
}

server := framework.SharedKcpServer(t)
Expand Down

0 comments on commit dfa03d6

Please sign in to comment.