fix(studio): render complete interactive gallery previews
This commit is contained in:
1 parent
c765d76a06
commit
9520651330
26 files changed
+5761
-39
No files matched your search
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user