diff --git a/client/client_test.go b/client/client_test.go index a1f0473..66b6a43 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1639,6 +1639,21 @@ func testTui_resize(t *testing.T) { out = stripTuiCommandPrefix(t, out) testutils.CompareGoldens(t, out, "TestTui-SmallTerminal") + // Check the output when the size is tiny + out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 100, 15, []TmuxCommand{ + {Keys: "hishtory SPACE tquery ENTER"}, + }) + out = stripTuiCommandPrefix(t, out) + testutils.CompareGoldens(t, out, "TestTui-TinyTerminal") + + // Check the output when the size is tiny and the help page is open + out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 100, 15, []TmuxCommand{ + {Keys: "hishtory SPACE tquery ENTER"}, + {Keys: "C-h"}, + }) + out = stripTuiCommandPrefix(t, out) + testutils.CompareGoldens(t, out, "TestTui-TinyTerminalHelp") + // Check that it resizes after the terminal size is adjusted manuallySubmitHistoryEntry(t, userSecret, testutils.MakeFakeHistoryEntry("echo 'cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'")) out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 100, 20, []TmuxCommand{ diff --git a/client/lib/goldens/TestTui-LongQuery b/client/lib/goldens/TestTui-LongQuery index 2e18cfd..6420e93 100644 --- a/client/lib/goldens/TestTui-LongQuery +++ b/client/lib/goldens/TestTui-LongQuery @@ -11,5 +11,7 @@ Search Query: > 1234567890qwertyuip1234567890qwertyuip1234567890qwertyuip1234567 │ │ │ │ │ │ +│ │ +│ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ hiSHtory: Search your shell history • ctrl+h help \ No newline at end of file diff --git a/client/lib/goldens/TestTui-SmallTerminal b/client/lib/goldens/TestTui-SmallTerminal index 000794b..e19df5a 100644 --- a/client/lib/goldens/TestTui-SmallTerminal +++ b/client/lib/goldens/TestTui-SmallTerminal @@ -11,5 +11,7 @@ Search Query: > ls │ │ │ │ │ │ +│ │ +│ │ └────────────────────────────────────────────────────────────────────────────────────────────┘ hiSHtory: Search your shell history • ctrl+h help \ No newline at end of file diff --git a/client/lib/goldens/TestTui-TinyTerminal b/client/lib/goldens/TestTui-TinyTerminal new file mode 100644 index 0000000..03b061c --- /dev/null +++ b/client/lib/goldens/TestTui-TinyTerminal @@ -0,0 +1,12 @@ +Search Query: > ls + +┌────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history • ctrl+h help \ No newline at end of file diff --git a/client/lib/goldens/TestTui-TinyTerminalHelp b/client/lib/goldens/TestTui-TinyTerminalHelp new file mode 100644 index 0000000..eda61e2 --- /dev/null +++ b/client/lib/goldens/TestTui-TinyTerminalHelp @@ -0,0 +1,12 @@ +Search Query: > ls + +┌────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ │ +hiSHtory: Search your shell history +↑ scroll up +← move left +enter select an entry +ctrl+x select an entry and cd into that directory \ No newline at end of file