Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Co-authored-by: Boris Od <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
cben committed May 11, 2021
1 parent b70520c commit c76b789
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions survey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ func TestPagination_lastHalf(t *testing.T) {
}

func TestAsk(t *testing.T) {
t.Skip()
return
tests := []struct {
name string
questions []*Question
Expand Down Expand Up @@ -174,13 +172,15 @@ func TestAsk(t *testing.T) {
Message: "What is your name?",
},
},
/* TODO gets stuck
{
Name: "day",
Prompt: &MultiSelect{
Message: "What days do you prefer:",
Options: []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"},
},
},
*/
{
Name: "password",
Prompt: &Password{
Expand Down Expand Up @@ -226,6 +226,7 @@ func TestAsk(t *testing.T) {
c.ExpectString("What is your name?")
c.SendLine("Johnny Appleseed")

/* TODO gets stuck
// MultiSelect
c.ExpectString("What days do you prefer: [Use arrows to move, space to select, type to filter]")
// Select Monday.
Expand All @@ -235,6 +236,7 @@ func TestAsk(t *testing.T) {
c.Send(string(terminal.KeyArrowDown))
c.Send(string(terminal.KeyArrowDown))
c.SendLine(" ")
*/

// Password
c.ExpectString("Please type your password")
Expand All @@ -250,10 +252,12 @@ func TestAsk(t *testing.T) {
"pizza": true,
"commit-message": "Add editor prompt tests\n",
"commit-message-validated": "Add editor prompt tests\n",
"name": "Johnny Appleseed",
"day": []string{"Monday", "Wednesday"},
"name": "Johnny Appleseed",
/* TODO
"day": []string{"Monday", "Wednesday"},
*/
"password": "secret",
"color": "yellow",
"color": core.OptionAnswer{Index: 3, Value: "yellow"},
},
},
{
Expand All @@ -271,6 +275,7 @@ func TestAsk(t *testing.T) {
c.ExpectString("What is your name?")
c.SendLine("")
c.ExpectString("Sorry, your reply was invalid: Value is required")
time.Sleep(time.Millisecond)
c.SendLine("Johnny Appleseed")
c.ExpectEOF()
},
Expand Down

0 comments on commit c76b789

Please sign in to comment.