More math components
This commit is contained in:
@ -0,0 +1,51 @@
|
||||
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({
|
||||
child: new MathRun("60"),
|
||||
});
|
||||
|
||||
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"],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user