Skip to content

test(cli): ensure first option selected with is expected #9770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make lint
  • Loading branch information
mtojek committed Sep 19, 2023
commit 6003205c0e580ae0a9e1c3dc1d356c9d6533e4fe
12 changes: 4 additions & 8 deletions cli/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ func TestUpdateValidateRichParameters(t *testing.T) {
// Update the workspace
inv, root = clitest.New(t, "update", "my-workspace")
clitest.SetupConfig(t, client, root)

doneChan := make(chan struct{})
pty := ptytest.New(t).Attach(inv)
go func() {
Expand All @@ -613,7 +612,7 @@ func TestUpdateValidateRichParameters(t *testing.T) {
}()

matches := []string{
// UI select will pick "first_option".
// cliui.Select will pick "first_option".
"Planning workspace...", "",
}
for i := 0; i < len(matches); i += 2 {
Expand Down Expand Up @@ -650,8 +649,7 @@ func TestUpdateValidateRichParameters(t *testing.T) {
// Create new workspace
inv, root := clitest.New(t, "create", "my-workspace", "--yes", "--template", template.Name, "--parameter", fmt.Sprintf("%s=%s", stringParameterName, "2nd"))
clitest.SetupConfig(t, client, root)

pty := ptytest.New(t).Attach(inv)
ptytest.New(t).Attach(inv)
err := inv.Run()
require.NoError(t, err)

Expand All @@ -674,10 +672,8 @@ func TestUpdateValidateRichParameters(t *testing.T) {
// Update the workspace
inv, root = clitest.New(t, "update", "my-workspace")
clitest.SetupConfig(t, client, root)
pty = ptytest.New(t).Attach(inv)

doneChan := make(chan struct{})
pty = ptytest.New(t).Attach(inv)
pty := ptytest.New(t).Attach(inv)
go func() {
defer close(doneChan)
err := inv.Run()
Expand Down Expand Up @@ -817,7 +813,7 @@ func TestUpdateValidateRichParameters(t *testing.T) {
}()

matches := []string{
// UI select will pick "thi".
// cliui.Select will pick "thi".
"Planning workspace...", "",
}
for i := 0; i < len(matches); i += 2 {
Expand Down