Skip to content

Commit

Permalink
fix: revert original test & add new test
Browse files Browse the repository at this point in the history
  • Loading branch information
mponton committed Nov 20, 2022
1 parent c91ee03 commit 8ff8b73
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions interactive_select_printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ import (
)

func TestInteractiveSelectPrinter_Show(t *testing.T) {
go func() {
keyboard.SimulateKeyPress(keys.Down)
keyboard.SimulateKeyPress(keys.Down)
keyboard.SimulateKeyPress(keys.Enter)
}()
result, _ := pterm.DefaultInteractiveSelect.WithOptions([]string{"a", "b", "c", "d", "e"}).WithDefaultOption("b").Show()
testza.AssertEqual(t, "d", result)
}

func TestInteractiveSelectPrinter_Show_MaxHeightSlidingWindow(t *testing.T) {
go func() {
keyboard.SimulateKeyPress(keys.Up)
keyboard.SimulateKeyPress(keys.Up)
Expand Down

0 comments on commit 8ff8b73

Please sign in to comment.