Add math limit component (#2510)
This commit is contained in:
45
src/file/paragraph/math/n-ary/math-limit-upper.spec.ts
Normal file
45
src/file/paragraph/math/n-ary/math-limit-upper.spec.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
import { MathRun } from "../math-run";
|
||||
import { MathLimitUpper } from "./math-limit-upper";
|
||||
|
||||
describe("MathLimitUpper", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should create a MathLimitUpper with correct root key", () => {
|
||||
const mathLimitUpper = new MathLimitUpper({
|
||||
children: [new MathRun("x")],
|
||||
limit: [new MathRun("-")],
|
||||
});
|
||||
|
||||
const tree = new Formatter().format(mathLimitUpper);
|
||||
expect(tree).to.deep.equal({
|
||||
"m:limUpp": [
|
||||
{
|
||||
"m:e": [
|
||||
{
|
||||
"m:r": [
|
||||
{
|
||||
"m:t": ["x"],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
"m:lim": [
|
||||
{
|
||||
"m:r": [
|
||||
{
|
||||
"m:t": ["-"],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user