test: add msubsup InvalidNumberOfChildrenError

This commit is contained in:
Alexandre Nunes 2020-10-03 11:19:07 -03:00
parent 8fc7b608a8
commit 083e564e2d
2 changed files with 23 additions and 0 deletions

@ -762,6 +762,16 @@ describe('#convert', () => {
expect(result).toBe('\\left(x + y\\right)_{0}^{1}');
});
describe('when it have four children', () => {
it('throws InvalidNumberOfChildrenError', () => {
const mathml = mathmlStrings.msubsupWithFourChildren;
const result = () => MathMLToLaTeX.convert(mathml);
expect(result).toThrow(new InvalidNumberOfChildrenError('msubsup', 3, 4));
});
});
});
describe('given math string with mtext', () => {

@ -1301,6 +1301,19 @@ export const msubsupWithMrow = `
</root>
`;
export const msubsupWithFourChildren = `
<root>
<math>
<msubsup>
<mo> &#x222B; </mo>
<mn> 0 </mn>
<mn> 1 </mn>
<mn> 5 </mn>
</msubsup>
</math>
</root>
`;
export const mtext = `
<root>
<math xmlns = "http://www.w3.org/1998/Math/MathML">