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

49 lines
1.5 KiB
TypeScript
Raw Normal View History

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