webRemoteControlFeatureGate.test.ts 668 B

123456789101112131415161718
  1. import { describe, expect, it } from "vitest";
  2. import { createWebRemoteControlFeatureGate } from "../src/main/webRemoteControlFeatureGate.js";
  3. describe("createWebRemoteControlFeatureGate", () => {
  4. it("allows development wiring", () => {
  5. const gate = createWebRemoteControlFeatureGate(true);
  6. expect(gate.isEnabled()).toBe(true);
  7. expect(() => gate.assertEnabled()).not.toThrow();
  8. });
  9. it("rejects production wiring before QR material is returned", () => {
  10. const gate = createWebRemoteControlFeatureGate(false);
  11. expect(gate.isEnabled()).toBe(false);
  12. expect(() => gate.assertEnabled()).toThrow("Web remote control is disabled");
  13. });
  14. });