mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-29 17:51:21 +01:00
Add test for forced compact mode (from #237)
This commit is contained in:
parent
30a7dcb3c7
commit
0c9a369c54
@ -1778,6 +1778,18 @@ func testTui_resize(t *testing.T) {
|
||||
})
|
||||
out = stripTuiCommandPrefix(t, out)
|
||||
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) {
|
||||
|
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…
Reference in New Issue
Block a user