Files
redis-gui-foundation/apps/desktop/src/lib/local-smoke-fixture.test.ts
Senior Frontend Engineer 291f744e0f refactor(desktop): harden workspace shell foundation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-31 04:03:38 +00:00

56 lines
1.5 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
isLocalSmokeFixtureConnection,
localSmokeFixtureCommandPresets,
localSmokeFixtureExpectedKeys,
localSmokeFixtureProfileId,
localSmokeFixtureSearchText,
} from "./local-smoke-fixture";
describe("local smoke fixture helpers", () => {
it("keeps the expected local smoke verification targets stable", () => {
expect(localSmokeFixtureProfileId).toBe("redis-local-fixture");
expect(localSmokeFixtureSearchText).toBe("smoke:*");
expect(localSmokeFixtureExpectedKeys).toEqual([
"smoke:string",
"smoke:string:ttl",
"smoke:hash",
"smoke:list",
"smoke:set",
"smoke:zset",
"smoke:stream",
]);
});
it("detects the built-in local fixture profile by id or target", () => {
expect(
isLocalSmokeFixtureConnection({
id: "redis-local-fixture",
target: { host: "10.0.0.1", port: 6379, database: 2 },
}),
).toBe(true);
expect(
isLocalSmokeFixtureConnection({
id: "custom-profile",
target: { host: "127.0.0.1", port: 6380, database: 0 },
}),
).toBe(true);
expect(
isLocalSmokeFixtureConnection({
id: "redis-local-fixture",
target: { host: "127.0.0.1", port: 6380, database: 1 },
}),
).toBe(true);
});
it("keeps fixture quick commands on a safe read-only path", () => {
expect(localSmokeFixtureCommandPresets.map((preset) => preset.command)).toEqual([
"PING",
"GET smoke:string",
"TTL smoke:string:ttl",
]);
});
});