Files
docx-js/src/file/paragraph/math/radical/math-degree.spec.ts

37 lines
1.0 KiB
TypeScript
Raw Normal View History

2020-10-10 13:41:26 +01:00
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { MathRun } from "../math-run";
import { MathDegree } from "./math-degree";
describe("MathDegree", () => {
describe("#constructor()", () => {
it("should create a MathDegree with correct root key", () => {
const mathDegree = new MathDegree();
const tree = new Formatter().format(mathDegree);
expect(tree).to.deep.equal({
"m:deg": {},
});
});
it("should create a MathDegree with correct root key with child", () => {
2020-10-13 02:06:27 +01:00
const mathDegree = new MathDegree([new MathRun("2")]);
2020-10-10 13:41:26 +01:00
const tree = new Formatter().format(mathDegree);
expect(tree).to.deep.equal({
"m:deg": [
{
"m:r": [
{
"m:t": ["2"],
},
],
},
],
});
});
});
});