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

46 lines
1.5 KiB
TypeScript
Raw Normal View History

2019-08-15 00:47:55 +01:00
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { MathDenominator } from "./math-denominator";
import { MathFraction } from "./math-fraction";
import { MathNumerator } from "./math-numerator";
describe("MathFraction", () => {
describe("#constructor()", () => {
it("should create a MathFraction with correct root key", () => {
const mathFraction = new MathFraction({
numerator: new MathNumerator("2"),
denominator: new MathDenominator("2"),
});
const tree = new Formatter().format(mathFraction);
expect(tree).to.deep.equal({
"m:f": [
{
"m:num": [
{
"m:r": [
{
"m:t": ["2"],
},
],
},
],
},
{
"m:den": [
{
"m:r": [
{
"m:t": ["2"],
},
],
},
],
},
],
});
});
});
});