@@ -5,21 +5,26 @@ import { formatSnapshotDiffText } from '../output.ts';
55test ( 'formatSnapshotDiffText renders unified diff lines with summary' , ( ) => {
66 const text = formatSnapshotDiffText ( {
77 baselineInitialized : false ,
8- summary : { additions : 2 , removals : 2 , unchanged : 2 } ,
8+ summary : { additions : 2 , removals : 2 , unchanged : 4 } ,
99 lines : [
10+ { kind : 'unchanged' , text : '@e0 [application]' } ,
1011 { kind : 'unchanged' , text : '@e2 [window]' } ,
1112 { kind : 'removed' , text : ' @e3 [other] "67"' } ,
1213 { kind : 'removed' , text : ' @e4 [text] "67"' } ,
1314 { kind : 'added' , text : ' @e3 [other] "134"' } ,
1415 { kind : 'added' , text : ' @e4 [text] "134"' } ,
1516 { kind : 'unchanged' , text : ' @e5 [button] "Increment"' } ,
17+ { kind : 'unchanged' , text : ' @e6 [text] "Footer"' } ,
1618 ] ,
1719 } ) ;
1820
21+ assert . doesNotMatch ( text , / ^ @ e 0 \[ a p p l i c a t i o n \] $ / m) ;
1922 assert . match ( text , / ^ @ e 2 \[ w i n d o w \] / m) ;
20- assert . match ( text , / ^ - @ e 3 \[ o t h e r \] " 6 7 " $ / m) ;
21- assert . match ( text , / ^ \+ @ e 3 \[ o t h e r \] " 1 3 4 " $ / m) ;
22- assert . match ( text , / 2 a d d i t i o n s , 2 r e m o v a l s , 2 u n c h a n g e d / ) ;
23+ assert . match ( text , / ^ - @ e 3 \[ o t h e r \] " 6 7 " $ / m) ;
24+ assert . match ( text , / ^ \+ @ e 3 \[ o t h e r \] " 1 3 4 " $ / m) ;
25+ assert . match ( text , / ^ @ e 5 \[ b u t t o n \] " I n c r e m e n t " $ / m) ;
26+ assert . doesNotMatch ( text , / ^ @ e 6 \[ t e x t \] " F o o t e r " $ / m) ;
27+ assert . match ( text , / 2 a d d i t i o n s , 2 r e m o v a l s , 4 u n c h a n g e d / ) ;
2328} ) ;
2429
2530test ( 'formatSnapshotDiffText renders baseline initialization text' , ( ) => {
0 commit comments