Fix test broken by 7ae9f15b by making sure input is sent and processed as separate events and updating the golden to reflect this

This commit is contained in:
David Dworken 2024-04-21 11:44:18 -07:00
parent 6e6c3c23cb
commit 0c79cbd3cc
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View File

@ -1870,7 +1870,9 @@ func testTui_defaultFilter(t *testing.T) {
// Run a search query, type something, and then delete the default filter // Run a search query, type something, and then delete the default filter
out = stripTuiCommandPrefix(t, captureTerminalOutput(t, tester, []string{ out = stripTuiCommandPrefix(t, captureTerminalOutput(t, tester, []string{
"hishtory SPACE tquery ENTER", "hishtory SPACE tquery ENTER",
"exit Left Left Left Left Left BSpace BSpace", "exit",
"Left Left Left Left Left",
"BSpace BSpace",
})) }))
testutils.CompareGoldens(t, out, "TestTui-DefaultFilter-DeletedWithText") testutils.CompareGoldens(t, out, "TestTui-DefaultFilter-DeletedWithText")
} }

View File

@ -1,8 +1,9 @@
Search Query: [exit_code:0] exit Search Query: exit
┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Hostname CWD Timestamp Runtime Exit Code Command │ │ Hostname CWD Timestamp Runtime Exit Code Command │
│────────────────────────────────────────────────────────────────────────────────────────────────────────│ │────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ localhost /tmp/ Oct 17 2022 21:43:31 PDT 3s 1 exit 1 │
│ localhost /tmp/ Oct 17 2022 21:43:26 PDT 3s 0 exit 0 │ │ localhost /tmp/ Oct 17 2022 21:43:26 PDT 3s 0 exit 0 │
│ │ │ │
│ │ │ │
@ -22,6 +23,5 @@ Search Query: [exit_code:0] exit
│ │ │ │
│ │ │ │
│ │ │ │
│ │
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ └────────────────────────────────────────────────────────────────────────────────────────────────────────┘
hiSHtory: Search your shell history • ctrl+h help hiSHtory: Search your shell history • ctrl+h help