fix(studio): render complete interactive gallery previews
Quality / quality (ubuntu-latest) (push) Failing after 10m12s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-10-19 17:40:50 +05:30
1 parent c765d76a06
commit 9520651330
26 files changed
+5761 -39

No files matched your search

+15 -1
View File
@@ -1,11 +1,25 @@
import { expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { chartConfiguration, chartTypes } from "../src/chart-config";
import {
chartConfiguration,
chartTypes,
chartTickLabel,
chartTooltipLines,
} from "../src/chart-config";
import { renderComponent, mountHtml } from "../../test/src/index";
import { discoverPlugins, createPluginRunner } from "../../plugin/src/index";
import { resolve } from "node:path";
const source = readFileSync(new URL("../components/Chart.wrn", import.meta.url), "utf8");
test("compact category ticks preserve the complete tooltip text", () => {
const label = "2026-10-17T10:03:00 · completed · audit-four";
expect(chartTickLabel(label, 18)).toHaveLength(18);
expect(chartTickLabel(label, 18)).toContain("…");
expect(chartTickLabel("Short", 18)).toBe("Short");
const lines = chartTooltipLines(label, 18);
expect(lines.every((line) => line.length <= 18)).toBe(true);
expect(lines.join("")).toBe(label);
});
for (const type of chartTypes) {
test(`Chart.js ${type} preserves native datasets`, () => {
const data = {