Add a test for custom columns for the classic non-TUI interface

This commit is contained in:
David Dworken 2022-10-27 22:31:59 -07:00
parent 7cfd03ccfe
commit 8b575e98c6
2 changed files with 23 additions and 0 deletions

View File

@ -1017,6 +1017,19 @@ func testDisplayTable(t *testing.T, tester shellTester) {
manuallySubmitHistoryEntry(t, userSecret, entry3)
out = hishtoryQuery(t, tester, "table")
compareGoldens(t, out, "testDisplayTable-customColumns-multiLineCommand")
// Add a custom column
tester.RunInteractiveShell(t, `hishtory config-add custom-columns foo "echo aaaaaaaaaaaaa"`)
tester.RunInteractiveShell(t, ` hishtory enable`)
tester.RunInteractiveShell(t, `echo table-1`)
tester.RunInteractiveShell(t, `echo table-2`)
tester.RunInteractiveShell(t, `echo bar`)
tester.RunInteractiveShell(t, ` hishtory disable`)
tester.RunInteractiveShell(t, `hishtory config-add displayed-columns foo`)
// And run a query and confirm it is displayed
out = hishtoryQuery(t, tester, "table")
compareGoldens(t, out, "testDisplayTable-customColumns-trulyCustom")
}
func testRequestAndReceiveDbDump(t *testing.T, tester shellTester) {

View File

@ -0,0 +1,10 @@
Hostname Exit Code Command CWD foo
Davids-MacBook-Air.local 0 echo table-2 ~/code/hishtory aaaaaaaaaaaaa
Davids-MacBook-Air.local 0 echo table-1 ~/code/hishtory aaaaaaaaaaaaa
Davids-MacBook-Air.local 0 hishtory query table ~/code/hishtory
localhost 2 while : /tmp/
do
ls /table/
done
localhost 3 table_cmd2 ~/foo/
localhost 2 table_cmd1 /tmp/