(t testing.TB, onlineStatus OnlineStatus)
| 1705 | } |
| 1706 | |
| 1707 | func setupTestTui(t testing.TB, onlineStatus OnlineStatus) (shellTester, string, *gorm.DB) { |
| 1708 | tester := zshTester{} |
| 1709 | userSecret := installWithOnlineStatus(t, tester, onlineStatus) |
| 1710 | assertOnlineStatus(t, onlineStatus) |
| 1711 | |
| 1712 | // Disable recording so that all our testing commands don't get recorded |
| 1713 | _, _ = tester.RunInteractiveShellRelaxed(t, ` hishtory disable`) |
| 1714 | |
| 1715 | // Insert a couple hishtory entries |
| 1716 | db := hctx.GetDb(hctx.MakeContext()) |
| 1717 | e1 := testutils.MakeFakeHistoryEntry("ls ~/") |
| 1718 | require.NoError(t, db.Create(e1).Error) |
| 1719 | if onlineStatus == Online { |
| 1720 | manuallySubmitHistoryEntry(t, userSecret, e1) |
| 1721 | } |
| 1722 | e2 := testutils.MakeFakeHistoryEntry("echo 'aaaaaa bbbb'") |
| 1723 | require.NoError(t, db.Create(e2).Error) |
| 1724 | if onlineStatus == Online { |
| 1725 | manuallySubmitHistoryEntry(t, userSecret, e2) |
| 1726 | } |
| 1727 | return tester, userSecret, db |
| 1728 | } |
| 1729 | |
| 1730 | func testTui_resize(t *testing.T) { |
| 1731 | // Setup |
no test coverage detected