/* * ============================================================================= * VibeQuant (vquant) — AI-Powered Financial Intelligence Platform * ----------------------------------------------------------------------------- * File: client/src/lib/queryClient.test.ts * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * Website: https://www.spboucher.ai * Demo: https://www.vquant.ai * License: MIT (see LICENSE) * * Copyright © 2026 Simon-Pierre Boucher. All rights reserved. * ============================================================================= */ import { describe, it, expect } from "vitest"; import { queryClient } from "./queryClient"; describe("queryClient", () => { it("is defined", () => { expect(queryClient).toBeDefined(); }); it("has staleTime set to 5 minutes", () => { const defaults = queryClient.getDefaultOptions(); expect(defaults.queries?.staleTime).toBe(5 * 60 * 1000); }); it("has gcTime set to 30 minutes", () => { const defaults = queryClient.getDefaultOptions(); expect(defaults.queries?.gcTime).toBe(30 * 60 * 1000); }); it("has retry set to 1", () => { const defaults = queryClient.getDefaultOptions(); expect(defaults.queries?.retry).toBe(1); }); it("has mutation retry disabled", () => { const defaults = queryClient.getDefaultOptions(); expect(defaults.mutations?.retry).toBe(false); }); it("does not refetch on window focus", () => { const defaults = queryClient.getDefaultOptions(); expect(defaults.queries?.refetchOnWindowFocus).toBe(false); }); });