-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(InfiniteScroll): Deprecate static instance method
- Loading branch information
1 parent
6696a37
commit 5ca7662
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { InfiniteScrollMock } from './inifinite-scroll'; | ||
|
||
describe('InfiniteScroll', () => { | ||
let classUnderTest: any; | ||
|
||
beforeEach(() => { | ||
classUnderTest = new InfiniteScrollMock(); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(classUnderTest).toBeDefined(); | ||
}); | ||
|
||
describe('complete', () => { | ||
it('should be defined', () => { | ||
expect(classUnderTest.complete).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('enable', () => { | ||
it('should be defined', () => { | ||
expect(classUnderTest.enable).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('waitFor', () => { | ||
it('should be defined', () => { | ||
expect(classUnderTest.waitFor).toBeDefined(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
export class InfiniteScrollMock { | ||
import { deprecated } from 'deprecated-decorator'; | ||
import { BaseMock } from '../base.mock'; | ||
|
||
const METHODS = ['complete', 'enable', 'waitFor']; | ||
|
||
export class InfiniteScrollMock extends BaseMock { | ||
|
||
constructor() { | ||
super('InfiniteScroll', METHODS); | ||
} | ||
|
||
@deprecated('new InfiniteScrollMock') | ||
public static instance(): any { | ||
return jasmine.createSpyObj('InfiniteScroll', ['complete', 'enable', 'waitFor']); | ||
return new InfiniteScrollMock(); | ||
} | ||
} |