11import { NgsgClassService } from './ngsg-class.service' ;
2- import createSpy = jasmine . createSpy ;
32
43describe ( 'NgsgClassService' , ( ) => {
54
@@ -8,56 +7,56 @@ describe('NgsgClassService', () => {
87 beforeEach ( ( ) => sut = new NgsgClassService ( ) ) ;
98
109 it ( 'should add the placeholder class' , ( ) => {
11- const addClassSpy = createSpy ( ) ;
10+ const addClassSpy = jest . fn ( ) ;
1211 const element = { classList : { add : addClassSpy } } as any ;
1312 sut . addPlaceHolderClass ( element ) ;
1413 expect ( addClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-placeholder' ) ;
1514 } ) ;
1615
1716 it ( 'should remove the placeholder class' , ( ) => {
18- const removeClassSpy = createSpy ( ) ;
17+ const removeClassSpy = jest . fn ( ) ;
1918 const element = { classList : { remove : removeClassSpy } } as any ;
2019 sut . removePlaceHolderClass ( element ) ;
2120 expect ( removeClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-placeholder' ) ;
2221 } ) ;
2322
2423 it ( 'should add the dropped class' , ( ) => {
25- const addClassSpy = createSpy ( ) ;
24+ const addClassSpy = jest . fn ( ) ;
2625 const element = { classList : { add : addClassSpy } } as any ;
2726 sut . addDroppedClass ( element ) ;
2827 expect ( addClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-dropped' ) ;
2928 } ) ;
3029
3130 it ( 'should remove the placeholder class' , ( ) => {
32- const removeClassSpy = createSpy ( ) ;
31+ const removeClassSpy = jest . fn ( ) ;
3332 const element = { classList : { remove : removeClassSpy } } as any ;
3433 sut . removeDroppedClass ( element ) ;
3534 expect ( removeClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-dropped' ) ;
3635 } ) ;
3736
3837 it ( 'should add the dropped class' , ( ) => {
39- const addClassSpy = createSpy ( ) ;
38+ const addClassSpy = jest . fn ( ) ;
4039 const element = { classList : { add : addClassSpy } } as any ;
4140 sut . addSelectedClass ( element ) ;
4241 expect ( addClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-selected' ) ;
4342 } ) ;
4443
4544 it ( 'should remove the placeholder class' , ( ) => {
46- const removeClassSpy = createSpy ( ) ;
45+ const removeClassSpy = jest . fn ( ) ;
4746 const element = { classList : { remove : removeClassSpy } } as any ;
4847 sut . removeSelectedClass ( element ) ;
4948 expect ( removeClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-selected' ) ;
5049 } ) ;
5150
5251 it ( 'should add the active class' , ( ) => {
53- const addClassSpy = createSpy ( ) ;
52+ const addClassSpy = jest . fn ( ) ;
5453 const element = { classList : { add : addClassSpy } } as any ;
5554 sut . addActiveClass ( element ) ;
5655 expect ( addClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-active' ) ;
5756 } ) ;
5857
5958 it ( 'should remove the active class' , ( ) => {
60- const removeClassSpy = createSpy ( ) ;
59+ const removeClassSpy = jest . fn ( ) ;
6160 const element = { classList : { remove : removeClassSpy } } as any ;
6261 sut . removeActiveClass ( element ) ;
6362 expect ( removeClassSpy ) . toHaveBeenCalledWith ( 'ng-sg-active' ) ;
0 commit comments