Commit e65c7aa8 authored by Luke Bennett's avatar Luke Bennett

eslint-fix

parent 597810df
...@@ -13,50 +13,50 @@ describe('popover', () => { ...@@ -13,50 +13,50 @@ describe('popover', () => {
popover: () => {}, popover: () => {},
toggleClass: () => {}, toggleClass: () => {},
}; };
expect(togglePopover.call(context, true)).toEqual(true); expect(togglePopover.call(context, true)).toEqual(true);
}); });
it('returns false when popover is already shown', () => { it('returns false when popover is already shown', () => {
const context = { const context = {
hasClass: () => true, hasClass: () => true,
}; };
expect(togglePopover.call(context, true)).toEqual(false); expect(togglePopover.call(context, true)).toEqual(false);
}); });
it('shows popover', (done) => { it('shows popover', (done) => {
const context = { const context = {
hasClass: () => false, hasClass: () => false,
popover: () => {}, popover: () => {},
toggleClass: () => {}, toggleClass: () => {},
}; };
spyOn(context, 'popover').and.callFake((method) => { spyOn(context, 'popover').and.callFake((method) => {
expect(method).toEqual('show'); expect(method).toEqual('show');
done(); done();
}); });
togglePopover.call(context, true); togglePopover.call(context, true);
}); });
it('adds disable-animation and js-popover-show class', (done) => { it('adds disable-animation and js-popover-show class', (done) => {
const context = { const context = {
hasClass: () => false, hasClass: () => false,
popover: () => {}, popover: () => {},
toggleClass: () => {}, toggleClass: () => {},
}; };
spyOn(context, 'toggleClass').and.callFake((classNames, show) => { spyOn(context, 'toggleClass').and.callFake((classNames, show) => {
expect(classNames).toEqual('disable-animation js-popover-show'); expect(classNames).toEqual('disable-animation js-popover-show');
expect(show).toEqual(true); expect(show).toEqual(true);
done(); done();
}); });
togglePopover.call(context, true); togglePopover.call(context, true);
}); });
}); });
describe('togglePopover(false)', () => { describe('togglePopover(false)', () => {
it('returns true when popover is hidden', () => { it('returns true when popover is hidden', () => {
const context = { const context = {
...@@ -64,46 +64,46 @@ describe('popover', () => { ...@@ -64,46 +64,46 @@ describe('popover', () => {
popover: () => {}, popover: () => {},
toggleClass: () => {}, toggleClass: () => {},
}; };
expect(togglePopover.call(context, false)).toEqual(true); expect(togglePopover.call(context, false)).toEqual(true);
}); });
it('returns false when popover is already hidden', () => { it('returns false when popover is already hidden', () => {
const context = { const context = {
hasClass: () => false, hasClass: () => false,
}; };
expect(togglePopover.call(context, false)).toEqual(false); expect(togglePopover.call(context, false)).toEqual(false);
}); });
it('hides popover', (done) => { it('hides popover', (done) => {
const context = { const context = {
hasClass: () => true, hasClass: () => true,
popover: () => {}, popover: () => {},
toggleClass: () => {}, toggleClass: () => {},
}; };
spyOn(context, 'popover').and.callFake((method) => { spyOn(context, 'popover').and.callFake((method) => {
expect(method).toEqual('hide'); expect(method).toEqual('hide');
done(); done();
}); });
togglePopover.call(context, false); togglePopover.call(context, false);
}); });
it('removes disable-animation and js-popover-show class', (done) => { it('removes disable-animation and js-popover-show class', (done) => {
const context = { const context = {
hasClass: () => true, hasClass: () => true,
popover: () => {}, popover: () => {},
toggleClass: () => {}, toggleClass: () => {},
}; };
spyOn(context, 'toggleClass').and.callFake((classNames, show) => { spyOn(context, 'toggleClass').and.callFake((classNames, show) => {
expect(classNames).toEqual('disable-animation js-popover-show'); expect(classNames).toEqual('disable-animation js-popover-show');
expect(show).toEqual(false); expect(show).toEqual(false);
done(); done();
}); });
togglePopover.call(context, false); togglePopover.call(context, false);
}); });
}); });
...@@ -158,4 +158,4 @@ describe('popover', () => { ...@@ -158,4 +158,4 @@ describe('popover', () => {
expect(spy).not.toHaveBeenCalled(); expect(spy).not.toHaveBeenCalled();
}); });
}); });
}); });
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment