Add test for beta-mode enabling highlighting of matching queries

This commit is contained in:
David Dworken 2023-09-24 17:57:40 -07:00
parent e04583f62f
commit 83c3664de6
No known key found for this signature in database

View File

@ -1659,6 +1659,13 @@ func testTui_color(t testing.TB) {
out = captureTerminalOutputComplex(t, tester, tester.ShellName(), 200, 50, []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, true)
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch")
// And one more time with beta-mode for highlighting matches
tester.RunInteractiveShell(t, ` hishtory config-set beta-mode true`)
require.Equal(t, "true", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get beta-mode`)))
out = captureTerminalOutputComplex(t, tester, tester.ShellName(), 200, 50, []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, true)
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch-BetaMode")
}
func testTui_delete(t testing.TB) {