test: add menclose InvalidNumberOfChildrenError case

This commit is contained in:
Alexandre Nunes 2020-10-03 10:52:21 -03:00
parent d5091be438
commit 876eba4760
2 changed files with 22 additions and 0 deletions

View File

@ -985,5 +985,15 @@ describe('#convert', () => {
expect(result).toBe('\\_{b}^{}X');
});
});
describe('with less than 3 children', () => {
it('throws InvalidNumberOfChildrenError', () => {
const mathml = mathmlStrings.mmultiscriptWithTwoChildren;
const result = () => MathMLToLaTeX.convert(mathml);
expect(result).toThrow(new InvalidNumberOfChildrenError('mmultiscripts', 3, 2, 'at least'));
});
});
});
});

View File

@ -1607,3 +1607,15 @@ export const mmultiscriptPresetOnly = `<math xmlns="http://www.w3.org/1998/Math/
</mmultiscripts>
</math>`;
export const mmultiscriptWithTwoChildren = `<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mmultiscripts>
<mrow>
<mi>N</mi>
<mi>a</mi>
</mrow>
<mrow>
<mn>11</mn>
</mrow>
</mmultiscripts>
</math>`;