File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -388,14 +388,16 @@ describe('Util', () => {
388388
389389 it ( 'createUniqueID' , ( ) => {
390390 let id = Util . createUniqueID ( ) ;
391- expect ( id ) . toBe ( 'id_0' ) ;
392- expect ( Util . lastSeqID ) . toBe ( 0 ) ;
391+ let lastSeqId = Util . lastSeqID ;
392+ expect ( id ) . toContain ( 'id_' ) ;
393+ expect ( id ) . toBe ( `id_${ lastSeqId } ` ) ;
393394 id = Util . createUniqueID ( 'custom_' ) ;
394- expect ( id ) . toBe ( 'custom_1 ') ;
395- expect ( Util . lastSeqID ) . toBe ( 1 ) ;
395+ expect ( id ) . toContain ( 'custom_ ') ;
396+ expect ( id ) . toBe ( `custom_ ${ lastSeqId + 1 } ` ) ;
396397 id = Util . createUniqueID ( ) ;
397- expect ( id ) . toBe ( 'id_2' ) ;
398- expect ( Util . lastSeqID ) . toBe ( 2 ) ;
398+ expect ( id ) . toContain ( 'id_' ) ;
399+ expect ( id ) . toBe ( `id_${ lastSeqId + 2 } ` ) ;
400+ expect ( lastSeqId + 2 ) . toBe ( Util . lastSeqID ) ;
399401 } )
400402
401403} ) ;
You can’t perform that action at this time.
0 commit comments