|
@@ -18,4 +18,30 @@ describe("mathjax", () => {
|
|
|
const metrics2 = measureTextElement(elements[1]);
|
|
|
expect(metrics1).toStrictEqual(metrics2);
|
|
|
});
|
|
|
+ it("minimum height remains", async () => {
|
|
|
+ await render(<ExcalidrawApp />);
|
|
|
+ await ensureSubtypesLoaded(["math"]);
|
|
|
+ const elements = [
|
|
|
+ API.createElement({ type: "text", id: "A", text: "a" }),
|
|
|
+ API.createElement({
|
|
|
+ type: "text",
|
|
|
+ id: "B",
|
|
|
+ text: "\\(\\alpha\\)",
|
|
|
+ subtype: "math",
|
|
|
+ customData: { useTex: true },
|
|
|
+ }),
|
|
|
+ API.createElement({
|
|
|
+ type: "text",
|
|
|
+ id: "C",
|
|
|
+ text: "`beta`",
|
|
|
+ subtype: "math",
|
|
|
+ customData: { useTex: false },
|
|
|
+ }),
|
|
|
+ ];
|
|
|
+ const height = measureTextElement(elements[0]).height;
|
|
|
+ const height1 = measureTextElement(elements[1]).height;
|
|
|
+ const height2 = measureTextElement(elements[2]).height;
|
|
|
+ expect(height).toEqual(height1);
|
|
|
+ expect(height).toEqual(height2);
|
|
|
+ });
|
|
|
});
|