diff --git a/client/client_test.go b/client/client_test.go index 89ed972..3fa3ff8 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1868,12 +1868,22 @@ func TestTui(t *testing.T) { out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1]) compareGoldens(t, out, "TestTui-InvalidSearch") - // Check the output when the size is adjusted + // Check the output when the size is smaller out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 100, 20, []string{ "hishtory SPACE tquery ENTER", }) out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1]) compareGoldens(t, out, "TestTui-SmallTerminal") + + // Check that we can use left arrow keys to scroll + out = captureTerminalOutput(t, tester, []string{ + "hishtory SPACE tquery ENTER", + "s", + "Left", + "l", + }) + out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1]) + compareGoldens(t, out, "TestTui-LeftScroll") } func captureTerminalOutput(t *testing.T, tester shellTester, commands []string) string { diff --git a/client/lib/goldens/TestTui-LeftScroll b/client/lib/goldens/TestTui-LeftScroll new file mode 100644 index 0000000..518ffb2 --- /dev/null +++ b/client/lib/goldens/TestTui-LeftScroll @@ -0,0 +1,26 @@ +Search Query: > ls + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ \ No newline at end of file