Add more tests to testIntegrationWithNewDevice

This commit is contained in:
David Dworken
2022-11-01 10:45:16 -07:00
parent acef5c0879
commit add3693967
3 changed files with 71 additions and 0 deletions

View File

@ -273,6 +273,15 @@ func testIntegrationWithNewDevice(t *testing.T, tester shellTester) {
if diff := cmp.Diff(expectedOutput, out); diff != "" {
t.Fatalf("hishtory export mismatch (-expected +got):\n%s\nout=%#v", diff, out)
}
// And test the export for each shell without anything filtered out
out = tester.RunInteractiveShell(t, `hishtory export | grep -v 'hishtory init '`)
compareGoldens(t, out, "testIntegrationWithNewDevice-"+tester.ShellName())
// And test the table but with a subset of columns that is static
tester.RunInteractiveShell(t, `hishtory config-set displayed-columns Hostname 'Exit Code' Command`)
out = tester.RunInteractiveShell(t, `hishtory query | grep -v 'hishtory init '`)
compareGoldens(t, out, "testIntegrationWithNewDevice-table"+tester.ShellName())
}
func installHishtory(t *testing.T, tester shellTester, userSecret string) string {