Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 5 additions & 30 deletions testsuite/tests/input/tex/Action.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterAll, beforeEach, describe, it } from '@jest/globals';
import { getTokens, toXmlMatch, setupTex, tex2mml } from '#helpers';
import { afterAll, beforeEach, describe, expect, it } from '@jest/globals';
import { getTokens, setupTex, tex2mml } from '#helpers';
import '#js/input/tex/action/ActionConfiguration';

beforeEach(() => setupTex(['base', 'action']));
Expand All @@ -12,44 +12,19 @@ describe('Action', () => {
/********************************************************************************/

it('TextTip', () => {
toXmlMatch(
tex2mml('\\texttip{A}{B}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\texttip{A}{B}" display="block">
<maction actiontype="tooltip" data-latex="\\mathtip{A}{\\text{B}}">
<mi data-latex="A">A</mi>
<mtext data-latex="\\text{B}">B</mtext>
</maction>
</math>`
);
expect(tex2mml('\\texttip{A}{B}')).toMatchSnapshot();
});

/********************************************************************************/

it('MathTip', () => {
toXmlMatch(
tex2mml('\\mathtip{A}{B}'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\mathtip{A}{B}" display="block">
<maction actiontype="tooltip" data-latex="\\mathtip{A}{B}">
<mi data-latex="A">A</mi>
<mi data-latex="B">B</mi>
</maction>
</math>`
);
expect(tex2mml('\\mathtip{A}{B}')).toMatchSnapshot();
});

/********************************************************************************/

it('Toggle', () => {
toXmlMatch(
tex2mml('\\toggle A B C \\endtoggle'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\toggle A B C \\endtoggle" display="block">
<maction data-latex="\\toggle A B C \\endtoggle">
<mi data-latex="A">A</mi>
<mi data-latex="B">B</mi>
<mi data-latex="C">C</mi>
</maction>
</math>`
);
expect(tex2mml('\\toggle A B C \\endtoggle')).toMatchSnapshot();
});

/********************************************************************************/
Expand Down
Loading
Loading