Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python
776 B
Raw Blame
import assert from "node:assert/strict";
import { describe, it } from "vitest";
import { refreshConsoleStatusQueries } from "./refresh";

describe("refreshConsoleStatusQueries", () => {
  it("refetches status and provider health when the provider query is enabled", () => {
    const calls: string[] = [];
    refreshConsoleStatusQueries(
      () => calls.push("status"),
      () => calls.push("provider"),
      true,
    );
    assert.deepEqual(calls, ["status", "provider"]);
  });

  it("skips provider health refetch when the provider query is disabled", () => {
    const calls: string[] = [];
    refreshConsoleStatusQueries(
      () => calls.push("status"),
      () => calls.push("provider"),
      false,
    );
    assert.deepEqual(calls, ["status"]);
  });
});