test: add mfenced and mtable as Vmatrix

This commit is contained in:
Alexandre Nunes 2020-09-19 16:00:31 -03:00
parent be71eaa8ef
commit 4a4ca1948f

@ -450,6 +450,37 @@ describe('#convert', () => {
expect(result).toBe('A = \\begin{Bmatrix}\n x & y \\\\\n z & w \n\\end{Bmatrix}'.replace(/\n/g, ''));
});
});
describe('with open attribute as ||', () => {
it('returns a pmatrix representation in latex', () => {
const mathml = `
<root>
<math xmlns = "http://www.w3.org/1998/Math/MathML">
<mrow>
<mi>A</mi>
<mo>=</mo>
<mfenced open = "||" close="||">
<mtable>
<mtr>
<mtd><mi>x</mi></mtd>
<mtd><mi>y</mi></mtd>
</mtr>
<mtr>
<mtd><mi>z</mi></mtd>
<mtd><mi>w</mi></mtd>
</mtr>
</mtable>
</mfenced>
</mrow>
</math>
</root>
`;
const result = MathMLToLaTeX.convert(mathml);
expect(result).toBe('A = \\begin{Vmatrix}\n x & y \\\\\n z & w \n\\end{Vmatrix}'.replace(/\n/g, ''));
});
});
});
});
});