mirror of
https://github.com/Heretek-AI/ompweb.git
synced 2026-11-09 18:51:28 -10:00
- Add Usage tab to Settings dialog with interactive token, cost, and cache analytics - Implement persistent SQLite usage store in ~/.omp/agent/usage.db with incremental mtime sync - Provide standard model rate catalog and models.yml custom rate resolution - Add responsive SVG area time-series chart with hover crosshair and per-provider tooltips - Include 5 metric cards, breakdown tables by model/day/project, and cost quality tracking - Add localization support across English, Japanese, and Simplified Chinese - Add comprehensive test suite across rates, service, SQLite store, and UI components
20 lines
662 B
JavaScript
20 lines
662 B
JavaScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import React from "react";
|
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
import { createJiti } from "jiti";
|
|
|
|
const jiti = createJiti(import.meta.url, {
|
|
jsx: { runtime: "automatic" },
|
|
tsconfigPaths: true,
|
|
});
|
|
|
|
const { UsageConfig } = await jiti.import("./UsageConfig.tsx");
|
|
|
|
test("UsageConfig renders static markup without crashing", () => {
|
|
const html = renderToStaticMarkup(React.createElement(UsageConfig));
|
|
assert.ok(html.length > 0);
|
|
// Initial state renders the loading indicator
|
|
assert.ok(html.includes("Loading usage analytics") || html.includes("Usage"));
|
|
});
|