test: add mfenced and mtable as vmatrix

This commit is contained in:
Alexandre Nunes 2020-09-19 15:54:45 -03:00
parent 60c649b8eb
commit 0d22978fcf
1 changed files with 33 additions and 2 deletions

View File

@ -358,8 +358,8 @@ describe('#convert', () => {
});
});
describe('with open attribute as [', () => {
it('returns a bmatrix representation in latex', () => {
describe('with open attribute as (', () => {
it('returns a pmatrix representation in latex', () => {
const mathml = `
<root>
<math xmlns = "http://www.w3.org/1998/Math/MathML">
@ -388,6 +388,37 @@ describe('#convert', () => {
expect(result).toBe('A = \\begin{pmatrix}\n x & y \\\\\n z & w \n\\end{pmatrix}'.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, ''));
});
});
});
});
});