debian-mirror-gitlab/spec/frontend/super_sidebar/components/super_sidebar_spec.js

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

34 lines
817 B
JavaScript
Raw Normal View History

2023-03-17 16:20:25 +05:30
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import SuperSidebar from '~/super_sidebar/components/super_sidebar.vue';
import UserBar from '~/super_sidebar/components/user_bar.vue';
import { sidebarData } from '../mock_data';
describe('SuperSidebar component', () => {
let wrapper;
const findUserBar = () => wrapper.findComponent(UserBar);
afterEach(() => {
wrapper.destroy();
});
const createWrapper = (props = {}) => {
wrapper = shallowMountExtended(SuperSidebar, {
propsData: {
sidebarData,
...props,
},
});
};
describe('default', () => {
beforeEach(() => {
createWrapper();
});
it('renders UserBar with sidebarData', () => {
expect(findUserBar().props('sidebarData')).toBe(sidebarData);
});
});
});