Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/vue_shared/components/members/action_buttons/resend_invite_button_spec.js')
-rw-r--r--spec/frontend/vue_shared/components/members/action_buttons/resend_invite_button_spec.js66
1 files changed, 0 insertions, 66 deletions
diff --git a/spec/frontend/vue_shared/components/members/action_buttons/resend_invite_button_spec.js b/spec/frontend/vue_shared/components/members/action_buttons/resend_invite_button_spec.js
deleted file mode 100644
index 859fdd01043..00000000000
--- a/spec/frontend/vue_shared/components/members/action_buttons/resend_invite_button_spec.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import { shallowMount, createLocalVue } from '@vue/test-utils';
-import Vuex from 'vuex';
-import { GlButton } from '@gitlab/ui';
-import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
-import ResendInviteButton from '~/vue_shared/components/members/action_buttons/resend_invite_button.vue';
-
-jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' }));
-
-const localVue = createLocalVue();
-localVue.use(Vuex);
-
-describe('ResendInviteButton', () => {
- let wrapper;
-
- const createStore = (state = {}) => {
- return new Vuex.Store({
- state: {
- memberPath: '/groups/foo-bar/-/group_members/:id',
- ...state,
- },
- });
- };
-
- const createComponent = (propsData = {}, state) => {
- wrapper = shallowMount(ResendInviteButton, {
- localVue,
- store: createStore(state),
- propsData: {
- memberId: 1,
- ...propsData,
- },
- directives: {
- GlTooltip: createMockDirective(),
- },
- });
- };
-
- const findForm = () => wrapper.find('form');
- const findButton = () => findForm().find(GlButton);
-
- beforeEach(() => {
- createComponent();
- });
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- it('displays a tooltip', () => {
- expect(getBinding(findButton().element, 'gl-tooltip')).not.toBeUndefined();
- expect(findButton().attributes('title')).toBe('Resend invite');
- });
-
- it('submits the form when button is clicked', () => {
- expect(findButton().attributes('type')).toBe('submit');
- });
-
- it('displays form with correct action and inputs', () => {
- expect(findForm().attributes('action')).toBe('/groups/foo-bar/-/group_members/1/resend_invite');
- expect(
- findForm()
- .find('input[name="authenticity_token"]')
- .attributes('value'),
- ).toBe('mock-csrf-token');
- });
-});