mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-19 03:26:46 +02:00
Add test for forced compact mode (from #237)
This commit is contained in:
parent
02f6934d9d
commit
cc65735b0e
@ -1778,6 +1778,18 @@ func testTui_resize(t *testing.T) {
|
|||||||
})
|
})
|
||||||
out = stripTuiCommandPrefix(t, out)
|
out = stripTuiCommandPrefix(t, out)
|
||||||
testutils.CompareGoldens(t, out, "TestTui-LongQuery")
|
testutils.CompareGoldens(t, out, "TestTui-LongQuery")
|
||||||
|
|
||||||
|
// Toggle on forced compact mode and check that it respects that even with a large terminal
|
||||||
|
require.Equal(t, "false", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get compact-mode`)))
|
||||||
|
tester.RunInteractiveShell(t, `hishtory config-set compact-mode true`)
|
||||||
|
require.Equal(t, "true", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get compact-mode`)))
|
||||||
|
out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 150, 60, []TmuxCommand{
|
||||||
|
{Keys: "hishtory SPACE tquery ENTER"},
|
||||||
|
})
|
||||||
|
out = stripTuiCommandPrefix(t, out)
|
||||||
|
testutils.CompareGoldens(t, out, "TestTui-ForcedCompactMode")
|
||||||
|
tester.RunInteractiveShell(t, `hishtory config-set compact-mode false`)
|
||||||
|
require.Equal(t, "false", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get compact-mode`)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func testTui_scroll(t *testing.T) {
|
func testTui_scroll(t *testing.T) {
|
||||||
|
25
client/testdata/TestTui-ForcedCompactMode
vendored
Normal file
25
client/testdata/TestTui-ForcedCompactMode
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Search Query: > ls
|
||||||
|
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
|
│ Hostname CWD Timestamp Runtime Exit Code Command │
|
||||||
|
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||||
|
│ localhost /tmp/ Oct 17 2022 21:43:26 PDT 3s 2 echo 'ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc… │
|
||||||
|
│ 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 ~/ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
Loading…
x
Reference in New Issue
Block a user