debian-mirror-gitlab/spec/frontend/search_settings/mount_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
932 B
JavaScript
Raw Normal View History

2021-03-11 19:13:27 +05:30
import { setHTMLFixture } from 'helpers/fixtures';
import mount from '~/search_settings/mount';
import { expandSection, closeSection } from '~/settings_panels';
jest.mock('~/settings_panels');
describe('search_settings/mount', () => {
let app;
beforeEach(() => {
const el = document.createElement('div');
setHTMLFixture('<div id="content-body"></div>');
app = mount({ el });
});
afterEach(() => {
app.$destroy();
});
it('calls settings_panel.onExpand when expand event is emitted', () => {
const section = { name: 'section' };
app.$refs.searchSettings.$emit('expand', section);
expect(expandSection).toHaveBeenCalledWith(section);
});
it('calls settings_panel.closeSection when collapse event is emitted', () => {
const section = { name: 'section' };
app.$refs.searchSettings.$emit('collapse', section);
expect(closeSection).toHaveBeenCalledWith(section);
});
});