Basic test for custom columns

This commit is contained in:
David Dworken 2022-10-27 21:28:37 -07:00
parent fb258627df
commit bed19f5316
4 changed files with 14 additions and 2 deletions

View File

@ -992,7 +992,15 @@ func testDisplayTable(t *testing.T, tester shellTester) {
// Query and check the table // Query and check the table
out := hishtoryQuery(t, tester, "table") out := hishtoryQuery(t, tester, "table")
compareGoldens(t, out, "testDisplayTable") compareGoldens(t, out, "testDisplayTable-defaultColumns")
// Adjust the columns that should be displayed
tester.RunInteractiveShell(t, ` hishtory disable`)
tester.RunInteractiveShell(t, `hishtory config-set displayed-columns Hostname Command`)
// And check the table again
out = hishtoryQuery(t, tester, "table")
compareGoldens(t, out, "testDisplayTable-customColumns")
} }
func testRequestAndReceiveDbDump(t *testing.T, tester shellTester) { func testRequestAndReceiveDbDump(t *testing.T, tester shellTester) {

View File

@ -1,4 +1,4 @@
Search Query: > echo caSearch Query: > echo
┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Hostname CWD Timestamp Runtime Exit Code Command │ │ Hostname CWD Timestamp Runtime Exit Code Command │

View File

@ -0,0 +1,4 @@
Hostname Command
Davids-MacBook-Air.local hishtory query table
localhost table_cmd2
localhost table_cmd1