52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
import { expect } from "chai";
|
|
|
|
import { Formatter } from "export/formatter";
|
|
|
|
import { MathRun } from "../math-run";
|
|
import { MathAngledBrackets } from "./math-angled-brackets";
|
|
|
|
describe("MathAngledBrackets", () => {
|
|
describe("#constructor()", () => {
|
|
it("should create a MathAngledBrackets with correct root key", () => {
|
|
const mathAngledBrackets = new MathAngledBrackets({
|
|
child: new MathRun("60"),
|
|
});
|
|
|
|
const tree = new Formatter().format(mathAngledBrackets);
|
|
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"],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
});
|
|
});
|
|
});
|
|
});
|