fix : dont break new line on export image
CI / Verify (push) Successful in 1m45s
CI / Build immutable images and deploy (push) Successful in 2m6s

This commit is contained in:
2026-09-26 13:48:29 +07:00 Unverified
parent 75a47aa14c
commit af879c03bd
2 changed files with 128 additions and 0 deletions
+15
View File
@@ -5,6 +5,7 @@ import { describe, expect, it } from "vitest";
import {
GuideImageExport,
imageExportFileName,
scaledExportFontSize,
} from "@/components/public/guide-image-export";
import { MaterialPoster } from "@/components/public/material-poster";
import { ConstellationImage } from "@/components/public/constellation-image";
@@ -104,6 +105,20 @@ describe("image export filenames", () => {
});
});
describe("image export text fitting", () => {
it("keeps the original font size when text already fits", () => {
expect(scaledExportFontSize(32, 180, 240)).toBe(32);
});
it("scales overflowing text to the available width", () => {
expect(scaledExportFontSize(32, 320, 240)).toBe(24);
});
it("has no minimum font-size floor for exceptionally long text", () => {
expect(scaledExportFontSize(32, 3200, 100)).toBe(1);
});
});
describe("material poster text", () => {
const props = {