2019-12-23 15:07:48 +00:00
|
|
|
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
|
2018-01-11 04:16:27 +00:00
|
|
|
import domContentLoaded from '~/feature_highlight/feature_highlight_options';
|
|
|
|
|
|
|
|
describe('feature highlight options', () => {
|
|
|
|
describe('domContentLoaded', () => {
|
|
|
|
it('should not call highlightFeatures when breakpoint is xs', () => {
|
2019-12-20 15:07:34 +00:00
|
|
|
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('xs');
|
2018-01-11 04:16:27 +00:00
|
|
|
|
|
|
|
expect(domContentLoaded()).toBe(false);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not call highlightFeatures when breakpoint is sm', () => {
|
2019-12-20 15:07:34 +00:00
|
|
|
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('sm');
|
2018-01-11 04:16:27 +00:00
|
|
|
|
|
|
|
expect(domContentLoaded()).toBe(false);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not call highlightFeatures when breakpoint is md', () => {
|
2019-12-20 15:07:34 +00:00
|
|
|
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('md');
|
2018-01-11 04:16:27 +00:00
|
|
|
|
|
|
|
expect(domContentLoaded()).toBe(false);
|
|
|
|
});
|
|
|
|
|
2019-12-23 15:07:48 +00:00
|
|
|
it('should not call highlightFeatures when breakpoint is not xl', () => {
|
2019-12-20 15:07:34 +00:00
|
|
|
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('lg');
|
2018-01-11 04:16:27 +00:00
|
|
|
|
2019-12-23 15:07:48 +00:00
|
|
|
expect(domContentLoaded()).toBe(false);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should call highlightFeatures when breakpoint is xl', () => {
|
|
|
|
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('xl');
|
|
|
|
|
2018-01-11 04:16:27 +00:00
|
|
|
expect(domContentLoaded()).toBe(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|