test: add munderover error test case
This commit is contained in:
parent
0ebed58ba0
commit
9d1f01d37c
@ -1,5 +1,6 @@
|
||||
import MathMLToLaTeX from '../src';
|
||||
import * as mathmlStrings from './mocks/mathmlStrings';
|
||||
import { InvalidNumberOfChild } from '../src/data/errors/InvalidNumberOfChild';
|
||||
|
||||
describe('#convert', () => {
|
||||
describe('given math string with mi tag', () => {
|
||||
@ -883,6 +884,16 @@ describe('#convert', () => {
|
||||
expect(result).toBe('\\int_{0}^{\\infty}');
|
||||
});
|
||||
});
|
||||
|
||||
describe('with munderover with 4 children', () => {
|
||||
it('should throws InvalidNumberOfChildErrors', () => {
|
||||
const mathml = mathmlStrings.munderoverWithThreeChildren;
|
||||
|
||||
const result = () => MathMLToLaTeX.convert(mathml);
|
||||
|
||||
expect(result).toThrow(new InvalidNumberOfChild('munderover', 3, 4));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('given math string with mmultiscript', () => {
|
||||
|
@ -1472,6 +1472,19 @@ export const munderoverEncoded = `
|
||||
</root>
|
||||
`;
|
||||
|
||||
export const munderoverWithThreeChildren = `
|
||||
<root>
|
||||
<math>
|
||||
<munderover>
|
||||
<mo> ∫</mo>
|
||||
<mn> 0 </mn>
|
||||
<mi> ∞ </mi>
|
||||
<mi> 1 </mi>
|
||||
</munderover>
|
||||
</math>
|
||||
</root>
|
||||
`;
|
||||
|
||||
export const mmultiscript = `<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
|
||||
<mmultiscripts>
|
||||
<mrow>
|
||||
|
Loading…
Reference in New Issue
Block a user