Add issauble_context_spec

This commit is contained in:
Luke "Jared" Bennett 2017-09-22 09:11:40 +01:00
parent 5629d46878
commit 0690381080
No known key found for this signature in database
GPG key ID: 402ED51FB5D306C2

View 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;
});
});
});