test: add mfrac InvalidNumberOfChildren error case

This commit is contained in:
Alexandre Nunes 2020-10-03 10:41:30 -03:00
parent 38fad7a173
commit bbc85a0b0f
2 changed files with 21 additions and 0 deletions

@ -321,6 +321,15 @@ describe('#convert', () => {
expect(result).toMatch('1/\\left(x^{3} + 3\\right)');
});
});
describe('containing three children', () => {
it('throws InvalidNumberOfChildren Error', () => {
const mathml = mathmlStrings.mfracWithThreeChildren;
const result = () => MathMLToLaTeX.convert(mathml);
expect(result).toThrow(new InvalidNumberOfChild('mfrac', 2, 3));
});
});
});
describe('given math string with mroot containing two content', () => {

@ -667,6 +667,18 @@ export const shortMFrac = `
</root>
`;
export const mfracWithThreeChildren = `
<root>
<math>
<mfrac>
<mi>x</mi>
<mn>3</mn>
<mi>2</mi>
</mfrac>
</math>
</root>
`;
export const mroot = `
<root>
<math>