mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-18 02:40:33 +02:00
Add tests for tiny terminals + update test goldens for tiny terminals after compact sizing
This commit is contained in:
@@ -1639,6 +1639,21 @@ func testTui_resize(t *testing.T) {
|
|||||||
out = stripTuiCommandPrefix(t, out)
|
out = stripTuiCommandPrefix(t, out)
|
||||||
testutils.CompareGoldens(t, out, "TestTui-SmallTerminal")
|
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
|
// Check that it resizes after the terminal size is adjusted
|
||||||
manuallySubmitHistoryEntry(t, userSecret, testutils.MakeFakeHistoryEntry("echo 'cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'"))
|
manuallySubmitHistoryEntry(t, userSecret, testutils.MakeFakeHistoryEntry("echo 'cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'"))
|
||||||
out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 100, 20, []TmuxCommand{
|
out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 100, 20, []TmuxCommand{
|
||||||
|
@@ -11,5 +11,7 @@ Search Query: > 1234567890qwertyuip1234567890qwertyuip1234567890qwertyuip1234567
|
|||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
hiSHtory: Search your shell history • ctrl+h help
|
hiSHtory: Search your shell history • ctrl+h help
|
@@ -11,5 +11,7 @@ Search Query: > ls
|
|||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
└────────────────────────────────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
hiSHtory: Search your shell history • ctrl+h help
|
hiSHtory: Search your shell history • ctrl+h help
|
12
client/lib/goldens/TestTui-TinyTerminal
Normal file
12
client/lib/goldens/TestTui-TinyTerminal
Normal file
@@ -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
|
12
client/lib/goldens/TestTui-TinyTerminalHelp
Normal file
12
client/lib/goldens/TestTui-TinyTerminalHelp
Normal file
@@ -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
|
Reference in New Issue
Block a user