Skip to content

Commit 446c2d0

Browse files
fbm3307rsoaresd
andauthored
SANDBOX-1392: Reg-svc pair Drop dependency on Che instance (codeready-toolchain#1198)
* SANDBOX-1392: Drop dependency on Che instance Signed-off-by: Feny Mehta <fbm3307@gmail.com> * merging the two assertresponseurl func Signed-off-by: Feny Mehta <fbm3307@gmail.com> * remove map Signed-off-by: Feny Mehta <fbm3307@gmail.com> --------- Signed-off-by: Feny Mehta <fbm3307@gmail.com> Co-authored-by: Rafaela Maria Soares da Silva <rsoaresd@redhat.com>
1 parent 88ee495 commit 446c2d0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/e2e/parallel/registration_service_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ func TestPhoneVerification(t *testing.T) {
636636
assert.Empty(t, mp["compliantUsername"])
637637
assert.Empty(t, mp["defaultUserNamespace"])
638638
assert.Empty(t, mp["rhodsMemberURL"])
639+
assert.Empty(t, mp["cheDashboardURL"])
639640
assert.Equal(t, identity0.Username, mp["username"])
640641
require.IsType(t, false, mpStatus["ready"])
641642
assert.False(t, mpStatus["ready"].(bool))
@@ -1051,7 +1052,8 @@ func signupIsProvisioned(client *GetSignupClient) {
10511052
assert.Equal(client.t, memberCluster.Status.APIEndpoint, client.responseBody["apiEndpoint"])
10521053
assert.Equal(client.t, hostAwait.APIProxyURL, client.responseBody["proxyURL"])
10531054
assert.Equal(client.t, fmt.Sprintf("%s-dev", transformedUsername), client.responseBody["defaultUserNamespace"])
1054-
assertRHODSClusterURL(client.t, memberAwait, client.responseBody)
1055+
assertResponseURL(client.t, memberAwait, "rhods-dashboard-redhat-ods-applications", "rhodsMemberURL", client.responseBody)
1056+
assertResponseURL(client.t, memberAwait, "devspaces", "cheDashboardURL", client.responseBody)
10551057
}
10561058

10571059
type GetSignupClient struct {
@@ -1091,6 +1093,7 @@ func assertGetSignupStatusPendingApproval(t *testing.T, await wait.Awaitilities,
10911093
assert.Equal(t, username, mp["username"], "unexpected username in response", mp, mpStatus)
10921094
assert.Empty(t, mp["defaultUserNamespace"])
10931095
assert.Empty(t, mp["rhodsMemberURL"])
1096+
assert.Empty(t, mp["cheDashboardURL"])
10941097
require.IsType(t, false, mpStatus["ready"])
10951098
assert.False(t, mpStatus["ready"].(bool))
10961099
assert.Equal(t, "PendingApproval", mpStatus["reason"])
@@ -1101,11 +1104,13 @@ func assertGetSignupReturnsNotFound(t *testing.T, await wait.Awaitilities, beare
11011104
NewHTTPRequest(t).InvokeEndpoint("GET", route+"/api/v1/signup", bearerToken, "", http.StatusNotFound)
11021105
}
11031106

1104-
func assertRHODSClusterURL(t *testing.T, memberAwait *wait.MemberAwaitility, response map[string]interface{}) {
1107+
func assertResponseURL(t *testing.T, memberAwait *wait.MemberAwaitility, hostname string, responseKey string, responseField map[string]interface{}) {
11051108
require.Containsf(t, memberAwait.GetConsoleURL(t), ".apps", "expected to find .apps in the console URL %s", memberAwait.GetConsoleURL(t))
11061109
index := strings.Index(memberAwait.GetConsoleURL(t), ".apps")
11071110
appsURL := memberAwait.GetConsoleURL(t)[index:]
1108-
assert.Equal(t, fmt.Sprintf("https://%s%s", "rhods-dashboard-redhat-ods-applications", appsURL), response["rhodsMemberURL"])
1111+
1112+
expectedURL := fmt.Sprintf("https://%s%s", hostname, appsURL)
1113+
assert.Equal(t, expectedURL, responseField[responseKey])
11091114
}
11101115

11111116
// waitForUserSignupReadyInRegistrationService waits and checks that the UserSignup is ready according to registration service /signup endpoint

0 commit comments

Comments
 (0)