Fix race condition in tests introduced by a79d4010581c5643a742f605c478f4a9cf9610b1

The race condition stems from the fact that queries are now async, so there is a chance this test hits ENTER before the new search queries have come in.
This commit is contained in:
David Dworken 2023-08-27 16:12:54 -07:00
parent 2294241003
commit eba27e7721
No known key found for this signature in database

View File

@ -1825,7 +1825,7 @@ func TestTui(t *testing.T) {
// Check the output when there is a selected result // Check the output when there is a selected result
out = captureTerminalOutput(t, tester, []string{ out = captureTerminalOutput(t, tester, []string{
"hishtory SPACE tquery ENTER", "hishtory SPACE tquery ENTER",
"ls ENTER", "ls", "ENTER",
}) })
out = strings.Split(strings.TrimSpace(strings.Split(out, "hishtory tquery")[1]), "\n")[0] out = strings.Split(strings.TrimSpace(strings.Split(out, "hishtory tquery")[1]), "\n")[0]
expected := `ls ~/` expected := `ls ~/`