Files
dbx/packages/app-tests/agentDriverUpdateBadge.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

31 lines
928 B
TypeScript

import assert from "node:assert/strict";
import { test } from "vitest";
import {
countAvailableAgentDriverUpdates,
countAvailableDriverUpdates,
} from "../../apps/desktop/src/lib/agentDriverUpdateBadge.ts";
test("returns zero when there are no available agent driver updates", () => {
assert.equal(countAvailableAgentDriverUpdates([]), 0);
assert.equal(countAvailableAgentDriverUpdates([{ update_available: false }, { update_available: false }]), 0);
});
test("counts available agent driver updates", () => {
assert.equal(
countAvailableAgentDriverUpdates([
{ update_available: true },
{ update_available: false },
{ update_available: true },
]),
2,
);
});
test("counts JDBC plugin update alongside agent driver updates", () => {
assert.equal(
countAvailableDriverUpdates([{ update_available: true }, { update_available: false }], { update_available: true }),
2,
);
});