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' ;
33import '#js/input/tex/action/ActionConfiguration' ;
44
55beforeEach ( ( ) => 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