diff --git a/src/file/paragraph/math/n-ary/math-integral.spec.ts b/src/file/paragraph/math/n-ary/math-integral.spec.ts new file mode 100644 index 0000000000..0944a3fb2b --- /dev/null +++ b/src/file/paragraph/math/n-ary/math-integral.spec.ts @@ -0,0 +1,68 @@ +import { expect } from "chai"; + +import { Formatter } from "@export/formatter"; + +import { MathRun } from "../math-run"; +import { MathIntegral } from "./math-integral"; + +describe("MathIntegral", () => { + describe("#constructor()", () => { + it("should create a MathIntegral with correct root key", () => { + const mathIntegral = new MathIntegral({ + children: [new MathRun("1")], + subScript: [new MathRun("2")], + superScript: [new MathRun("3")], + }); + + const tree = new Formatter().format(mathIntegral); + expect(tree).to.deep.equal({ + "m:nary": [ + { + "m:naryPr": [ + { + "m:limLoc": { + _attr: { + "m:val": "undOvr", + }, + }, + }, + ], + }, + { + "m:sub": [ + { + "m:r": [ + { + "m:t": ["2"], + }, + ], + }, + ], + }, + { + "m:sup": [ + { + "m:r": [ + { + "m:t": ["3"], + }, + ], + }, + ], + }, + { + "m:e": [ + { + "m:r": [ + { + "m:t": ["1"], + }, + ], + }, + ], + }, + ], + }); + }); + }); +});