Files
ompweb/components/UsageConfig.test.mjs
Khaled Ahmed 6c721e6ffd feat(settings): add Usage analytics dashboard with persistent SQLite store
- 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
2026-09-01 16:21:08 +03:00

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"));
});