fix : dont break new line on export image
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user