mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test: rename ExpectMatchContext to ExpectMatch (#25998)
Cleans the last few instances of ExpectMatch that didn't use the new `(ctx, ...)` variant, then deletes the deprecated method and renames `ExpectMatchContext` to drop the `Context` suffix.
This commit is contained in:
@@ -131,14 +131,14 @@ func TestServerCreateAdminUser(t *testing.T) {
|
||||
stdout := expecter.NewAttachedToInvocation(t, inv)
|
||||
clitest.Start(t, inv)
|
||||
|
||||
stdout.ExpectMatchContext(ctx, "Creating user...")
|
||||
stdout.ExpectMatchContext(ctx, "Generating user SSH key...")
|
||||
stdout.ExpectMatchContext(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org1Name, org1ID.String()))
|
||||
stdout.ExpectMatchContext(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org2Name, org2ID.String()))
|
||||
stdout.ExpectMatchContext(ctx, "User created successfully.")
|
||||
stdout.ExpectMatchContext(ctx, username)
|
||||
stdout.ExpectMatchContext(ctx, email)
|
||||
stdout.ExpectMatchContext(ctx, "****")
|
||||
stdout.ExpectMatch(ctx, "Creating user...")
|
||||
stdout.ExpectMatch(ctx, "Generating user SSH key...")
|
||||
stdout.ExpectMatch(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org1Name, org1ID.String()))
|
||||
stdout.ExpectMatch(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org2Name, org2ID.String()))
|
||||
stdout.ExpectMatch(ctx, "User created successfully.")
|
||||
stdout.ExpectMatch(ctx, username)
|
||||
stdout.ExpectMatch(ctx, email)
|
||||
stdout.ExpectMatch(ctx, "****")
|
||||
|
||||
verifyUser(t, connectionURL, username, email, password)
|
||||
})
|
||||
@@ -165,10 +165,10 @@ func TestServerCreateAdminUser(t *testing.T) {
|
||||
stdout := expecter.NewAttachedToInvocation(t, inv)
|
||||
clitest.Start(t, inv)
|
||||
|
||||
stdout.ExpectMatchContext(ctx, "User created successfully.")
|
||||
stdout.ExpectMatchContext(ctx, username)
|
||||
stdout.ExpectMatchContext(ctx, email)
|
||||
stdout.ExpectMatchContext(ctx, "****")
|
||||
stdout.ExpectMatch(ctx, "User created successfully.")
|
||||
stdout.ExpectMatch(ctx, username)
|
||||
stdout.ExpectMatch(ctx, email)
|
||||
stdout.ExpectMatch(ctx, "****")
|
||||
|
||||
verifyUser(t, connectionURL, username, email, password)
|
||||
})
|
||||
@@ -197,19 +197,19 @@ func TestServerCreateAdminUser(t *testing.T) {
|
||||
|
||||
clitest.Start(t, inv)
|
||||
|
||||
stdout.ExpectMatchContext(ctx, "Username")
|
||||
stdout.ExpectMatch(ctx, "Username")
|
||||
stdin.WriteLine(username)
|
||||
stdout.ExpectMatchContext(ctx, "Email")
|
||||
stdout.ExpectMatch(ctx, "Email")
|
||||
stdin.WriteLine(email)
|
||||
stdout.ExpectMatchContext(ctx, "Password")
|
||||
stdout.ExpectMatch(ctx, "Password")
|
||||
stdin.WriteLine(password)
|
||||
stdout.ExpectMatchContext(ctx, "Confirm password")
|
||||
stdout.ExpectMatch(ctx, "Confirm password")
|
||||
stdin.WriteLine(password)
|
||||
|
||||
stdout.ExpectMatchContext(ctx, "User created successfully.")
|
||||
stdout.ExpectMatchContext(ctx, username)
|
||||
stdout.ExpectMatchContext(ctx, email)
|
||||
stdout.ExpectMatchContext(ctx, "****")
|
||||
stdout.ExpectMatch(ctx, "User created successfully.")
|
||||
stdout.ExpectMatch(ctx, username)
|
||||
stdout.ExpectMatch(ctx, email)
|
||||
stdout.ExpectMatch(ctx, "****")
|
||||
|
||||
verifyUser(t, connectionURL, username, email, password)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user