2020-10-10 13:41:26 +01:00
|
|
|
import { expect } from "chai";
|
|
|
|
|
|
|
|
import { Formatter } from "export/formatter";
|
|
|
|
|
|
|
|
import { MathRun } from "../math-run";
|
|
|
|
import { MathSquareBrackets } from "./math-square-brackets";
|
|
|
|
|
|
|
|
describe("MathSquareBrackets", () => {
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create a MathSquareBrackets with correct root key", () => {
|
|
|
|
const mathSquareBrackets = new MathSquareBrackets({
|
2020-10-13 02:06:27 +01:00
|
|
|
children: [new MathRun("60")],
|
2020-10-10 13:41:26 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
const tree = new Formatter().format(mathSquareBrackets);
|
|
|
|
expect(tree).to.deep.equal({
|
|
|
|
"m:d": [
|
|
|
|
{
|
|
|
|
"m:dPr": [
|
|
|
|
{
|
|
|
|
"m:begChr": {
|
|
|
|
_attr: {
|
|
|
|
"m:val": "[",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"m:endChr": {
|
|
|
|
_attr: {
|
|
|
|
"m:val": "]",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"m:e": [
|
|
|
|
{
|
|
|
|
"m:r": [
|
|
|
|
{
|
|
|
|
"m:t": ["60"],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|