More math components
This commit is contained in:
48
src/file/paragraph/math/radical/math-radical.spec.ts
Normal file
48
src/file/paragraph/math/radical/math-radical.spec.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "export/formatter";
|
||||
|
||||
import { MathRun } from "../math-run";
|
||||
import { MathRadical } from "./math-radical";
|
||||
|
||||
describe("MathRadical", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should create a MathRadical with correct root key", () => {
|
||||
const mathRadical = new MathRadical({
|
||||
child: new MathRun("e"),
|
||||
degree: new MathRun("2"),
|
||||
});
|
||||
|
||||
const tree = new Formatter().format(mathRadical);
|
||||
expect(tree).to.deep.equal({
|
||||
"m:rad": [
|
||||
{
|
||||
"m:radPr": {},
|
||||
},
|
||||
{
|
||||
"m:deg": [
|
||||
{
|
||||
"m:r": [
|
||||
{
|
||||
"m:t": ["2"],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
"m:e": [
|
||||
{
|
||||
"m:r": [
|
||||
{
|
||||
"m:t": ["e"],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user