debian-mirror-gitlab/spec/frontend/feature_highlight/feature_highlight_options_spec.js

37 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-03-13 15:44:24 +05:30
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
2018-03-17 18:26:18 +05:30
import domContentLoaded from '~/feature_highlight/feature_highlight_options';
describe('feature highlight options', () => {
describe('domContentLoaded', () => {
it('should not call highlightFeatures when breakpoint is xs', () => {
2020-03-13 15:44:24 +05:30
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('xs');
2018-03-17 18:26:18 +05:30
expect(domContentLoaded()).toBe(false);
});
it('should not call highlightFeatures when breakpoint is sm', () => {
2020-03-13 15:44:24 +05:30
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('sm');
2018-03-17 18:26:18 +05:30
expect(domContentLoaded()).toBe(false);
});
it('should not call highlightFeatures when breakpoint is md', () => {
2020-03-13 15:44:24 +05:30
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('md');
2018-03-17 18:26:18 +05:30
expect(domContentLoaded()).toBe(false);
});
2020-03-13 15:44:24 +05:30
it('should not call highlightFeatures when breakpoint is not xl', () => {
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('lg');
expect(domContentLoaded()).toBe(false);
});
it('should call highlightFeatures when breakpoint is xl', () => {
jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('xl');
2018-03-17 18:26:18 +05:30
expect(domContentLoaded()).toBe(true);
});
});
});