diff --git a/__test__/index.test.ts b/__test__/index.test.ts index 870079d..3361b09 100755 --- a/__test__/index.test.ts +++ b/__test__/index.test.ts @@ -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', () => { diff --git a/__test__/mocks/mathmlStrings.ts b/__test__/mocks/mathmlStrings.ts index 24829c8..71200ff 100755 --- a/__test__/mocks/mathmlStrings.ts +++ b/__test__/mocks/mathmlStrings.ts @@ -1472,6 +1472,19 @@ export const munderoverEncoded = ` `; +export const munderoverWithThreeChildren = ` + + + + + 0 + + 1 + + + +`; + export const mmultiscript = `