Files
docx-js/src/file/paragraph/math/n-ary/math-super-script.spec.ts

28 lines
855 B
TypeScript
Raw Normal View History

2019-08-20 20:40:40 +01:00
import { expect } from "chai";
import { Formatter } from "@export/formatter";
2019-08-20 20:40:40 +01:00
import { MathRun } from "../math-run";
2020-10-10 13:41:26 +01:00
import { MathSuperScriptElement } from "./math-super-script";
2019-08-20 20:40:40 +01:00
2020-10-10 13:41:26 +01:00
describe("MathSuperScriptElement", () => {
2019-08-20 20:40:40 +01:00
describe("#constructor()", () => {
2020-10-10 13:41:26 +01:00
it("should create a MathSuperScriptElement with correct root key", () => {
2020-10-13 02:06:27 +01:00
const mathSuperScriptElement = new MathSuperScriptElement([new MathRun("2+2")]);
2019-08-20 20:40:40 +01:00
2020-10-10 13:41:26 +01:00
const tree = new Formatter().format(mathSuperScriptElement);
2019-08-20 20:40:40 +01:00
expect(tree).to.deep.equal({
"m:sup": [
{
"m:r": [
{
"m:t": ["2+2"],
},
],
},
],
});
});
});
});