docx
Version:
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
49 lines (44 loc) • 1.53 kB
text/typescript
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { MathRun } from "../../math-run";
import { MathSuperScript } from "./math-super-script-function";
describe("MathSuperScript", () => {
describe("#constructor()", () => {
it("should create a MathSuperScript with correct root key", () => {
const mathSuperScript = new MathSuperScript({
children: [new MathRun("e")],
superScript: [new MathRun("2")],
});
const tree = new Formatter().format(mathSuperScript);
expect(tree).to.deep.equal({
"m:sSup": [
{
"m:sSupPr": {},
},
{
"m:e": [
{
"m:r": [
{
"m:t": ["e"],
},
],
},
],
},
{
"m:sup": [
{
"m:r": [
{
"m:t": ["2"],
},
],
},
],
},
],
});
});
});
});