test: add msub InvalidNumberOfChildrenError case

This commit is contained in:
Alexandre Nunes 2020-10-03 11:15:06 -03:00
parent 8880e6db64
commit 8fc7b608a8
2 changed files with 22 additions and 0 deletions

@ -734,6 +734,16 @@ describe('#convert', () => {
expect(result).toMatch('\\left(x + y\\right)_{2 + 2}');
});
});
describe('msub tag contains three children', () => {
it('throws InvalidNumberOfChildrenError', () => {
const mathml = mathmlStrings.msubWithThreeChildren;
const result = () => MathMLToLaTeX.convert(mathml);
expect(result).toThrow(new InvalidNumberOfChildrenError('msub', 2, 3));
});
});
});
describe('given math string with msubsup tag', () => {

@ -1261,6 +1261,18 @@ export const msubWithMrowOnTopBottom = `
</root>
`;
export const msubWithThreeChildren = `
<root>
<math>
<msub>
<mi>x</mi>
<mn>2</mn>
<mn>3</mn>
</msub>
</math>
</root>
`;
export const msubsup = `
<root>
<math>