Files
dbx/packages/app-tests/historyActions.test.ts
T
t8y2 fabf2172e4 chore: migrate test runner from node:test/tsx to vitest
155 files, 1091 tests, 4.3s (2x faster than previous 9.1s).
2026-06-08 01:17:27 +08:00

15 lines
647 B
TypeScript

import { strict as assert } from "node:assert";
import { test } from "vitest";
import { shouldDeleteHistoryEntry, shouldClearHistory } from "../../apps/desktop/src/lib/historyActions.ts";
test("requires confirmation before deleting history entries", () => {
assert.equal(shouldDeleteHistoryEntry(() => false), false);
assert.equal(shouldDeleteHistoryEntry(() => true), true);
});
test("requires existing entries and confirmation before clearing history", () => {
assert.equal(shouldClearHistory(0, () => true), false);
assert.equal(shouldClearHistory(2, () => false), false);
assert.equal(shouldClearHistory(2, () => true), true);
});