Add issauble_context_spec
This commit is contained in:
parent
5629d46878
commit
0690381080
1 changed files with 31 additions and 0 deletions
31
spec/javascripts/issuable_context_spec.js
Normal file
31
spec/javascripts/issuable_context_spec.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
import '~/issuable_context';
|
||||
|
||||
fdescribe('IssuableContext', () => {
|
||||
describe('toggleHiddenParticipants', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
});
|
||||
|
||||
fit('calls loadCheck if lazyLoader is set', () => {
|
||||
gl.lazyLoader = jasmine.createSpyObj('lazyLoader', ['loadCheck']);
|
||||
const event = {};
|
||||
|
||||
IssuableContext.prototype.toggleHiddenParticipants(event);
|
||||
|
||||
expect(gl.lazyLoader.loadCheck).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('does not call loadCheck if lazyLoader is not set', () => {
|
||||
gl.lazyLoader = undefined;
|
||||
const event = {};
|
||||
|
||||
IssuableContext.prototype.toggleHiddenParticipants(event);
|
||||
|
||||
expect(gl.lazyLoader.loadCheck).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
gl.lazyLoader = undefined;
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue