test: add menclose InvalidNumberOfChildrenError case
This commit is contained in:
parent
d5091be438
commit
876eba4760
|
@ -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'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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>`;
|
||||
|
|
Loading…
Reference in New Issue