Skip to content

Commit 66a3ab2

Browse files
authored
Merge pull request #1442 from mathjax/tests/rewrite_to_snapshots
Tests/rewrite to snapshots
2 parents 5caee44 + 71f6868 commit 66a3ab2

File tree

84 files changed

+50369
-47674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+50369
-47674
lines changed

testsuite/tests/input/tex/Action.test.ts

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { afterAll, beforeEach, describe, it } from '@jest/globals';
2-
import { getTokens, toXmlMatch, setupTex, tex2mml } from '#helpers';
1+
import { afterAll, beforeEach, describe, expect, it } from '@jest/globals';
2+
import { getTokens, setupTex, tex2mml } from '#helpers';
33
import '#js/input/tex/action/ActionConfiguration';
44

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

1414
it('TextTip', () => {
15-
toXmlMatch(
16-
tex2mml('\\texttip{A}{B}'),
17-
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\texttip{A}{B}" display="block">
18-
<maction actiontype="tooltip" data-latex="\\mathtip{A}{\\text{B}}">
19-
<mi data-latex="A">A</mi>
20-
<mtext data-latex="\\text{B}">B</mtext>
21-
</maction>
22-
</math>`
23-
);
15+
expect(tex2mml('\\texttip{A}{B}')).toMatchSnapshot();
2416
});
2517

2618
/********************************************************************************/
2719

2820
it('MathTip', () => {
29-
toXmlMatch(
30-
tex2mml('\\mathtip{A}{B}'),
31-
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\mathtip{A}{B}" display="block">
32-
<maction actiontype="tooltip" data-latex="\\mathtip{A}{B}">
33-
<mi data-latex="A">A</mi>
34-
<mi data-latex="B">B</mi>
35-
</maction>
36-
</math>`
37-
);
21+
expect(tex2mml('\\mathtip{A}{B}')).toMatchSnapshot();
3822
});
3923

4024
/********************************************************************************/
4125

4226
it('Toggle', () => {
43-
toXmlMatch(
44-
tex2mml('\\toggle A B C \\endtoggle'),
45-
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\toggle A B C \\endtoggle" display="block">
46-
<maction data-latex="\\toggle A B C \\endtoggle">
47-
<mi data-latex="A">A</mi>
48-
<mi data-latex="B">B</mi>
49-
<mi data-latex="C">C</mi>
50-
</maction>
51-
</math>`
52-
);
27+
expect(tex2mml('\\toggle A B C \\endtoggle')).toMatchSnapshot();
5328
});
5429

5530
/********************************************************************************/

0 commit comments

Comments
 (0)