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