Fix spec
This commit is contained in:
parent
37a2ac7765
commit
25cf92252d
1 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import * as featureHighlightHelper from '~/feature_highlight/feature_highlight_helper';
|
|
||||||
import * as featureHighlight from '~/feature_highlight/feature_highlight';
|
import * as featureHighlight from '~/feature_highlight/feature_highlight';
|
||||||
|
import * as popover from '~/shared/popover';
|
||||||
import axios from '~/lib/utils/axios_utils';
|
import axios from '~/lib/utils/axios_utils';
|
||||||
import MockAdapter from 'axios-mock-adapter';
|
import MockAdapter from 'axios-mock-adapter';
|
||||||
|
|
||||||
|
@ -44,15 +44,15 @@ describe('feature highlight', () => {
|
||||||
expect($(selector).data('content')).toEqual(outerHTML);
|
expect($(selector).data('content')).toEqual(outerHTML);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('setup mouseenter', () => {
|
fit('setup mouseenter', () => {
|
||||||
const toggleSpy = spyOn(featureHighlightHelper.togglePopover, 'call');
|
const toggleSpy = spyOn(popover.togglePopover, 'call');
|
||||||
$(selector).trigger('mouseenter');
|
$(selector).trigger('mouseenter');
|
||||||
|
|
||||||
expect(toggleSpy).toHaveBeenCalledWith(jasmine.any(Object), true);
|
expect(toggleSpy).toHaveBeenCalledWith(jasmine.any(Object), true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('setup debounced mouseleave', (done) => {
|
it('setup debounced mouseleave', (done) => {
|
||||||
const toggleSpy = spyOn(featureHighlightHelper.togglePopover, 'call');
|
const toggleSpy = spyOn(popover.togglePopover, 'call');
|
||||||
$(selector).trigger('mouseleave');
|
$(selector).trigger('mouseleave');
|
||||||
|
|
||||||
// Even though we've set the debounce to 0ms, setTimeout is needed for the debounce
|
// Even though we've set the debounce to 0ms, setTimeout is needed for the debounce
|
||||||
|
@ -85,7 +85,7 @@ describe('feature highlight', () => {
|
||||||
it('toggles when clicked', () => {
|
it('toggles when clicked', () => {
|
||||||
$(selector).trigger('mouseenter');
|
$(selector).trigger('mouseenter');
|
||||||
const popoverId = $(selector).attr('aria-describedby');
|
const popoverId = $(selector).attr('aria-describedby');
|
||||||
const toggleSpy = spyOn(featureHighlightHelper.togglePopover, 'call');
|
const toggleSpy = spyOn(popover.togglePopover, 'call');
|
||||||
|
|
||||||
$(`#${popoverId} .dismiss-feature-highlight`).click();
|
$(`#${popoverId} .dismiss-feature-highlight`).click();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue