debian-mirror-gitlab/spec/frontend/members/components/table/member_activity_spec.js

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

41 lines
1 KiB
JavaScript
Raw Normal View History

2023-03-17 16:20:25 +05:30
import { mountExtended } from 'helpers/vue_test_utils_helper';
import MemberActivity from '~/members/components/table/member_activity.vue';
import { member as memberMock, group as groupLinkMock } from '../../mock_data';
describe('MemberActivity', () => {
let wrapper;
const defaultPropsData = {
member: memberMock,
};
const createComponent = ({ propsData = {} } = {}) => {
wrapper = mountExtended(MemberActivity, {
propsData: {
...defaultPropsData,
...propsData,
},
});
};
describe('with a member that has all fields', () => {
beforeEach(() => {
createComponent();
});
it('renders `User created`, `Access granted`, and `Last activity` fields', () => {
expect(wrapper.element).toMatchSnapshot();
});
});
describe('with a member that does not have all of the fields', () => {
beforeEach(() => {
createComponent({ propsData: { member: groupLinkMock } });
});
it('renders `User created` field', () => {
expect(wrapper.element).toMatchSnapshot();
});
});
});