2020-02-07 12:07:37 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
import Vuex from 'vuex';
|
|
|
|
|
|
|
|
import ProjectCreationSuccessPopup from '@/components/project/ProjectCreationSuccessPopup.vue';
|
|
|
|
|
|
|
|
import { appStateModule } from '@/store/modules/appState';
|
|
|
|
import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames';
|
2020-03-11 17:23:55 +00:00
|
|
|
import { createLocalVue, mount, shallowMount } from '@vue/test-utils';
|
|
|
|
|
|
|
|
const localVue = createLocalVue();
|
|
|
|
localVue.use(Vuex);
|
2020-02-07 12:07:37 +00:00
|
|
|
|
|
|
|
const store = new Vuex.Store({ modules: { appStateModule }});
|
|
|
|
|
|
|
|
describe('ProjectCreationSuccessPopup.vue', () => {
|
|
|
|
it('renders correctly', async (): Promise<void> => {
|
|
|
|
await store.dispatch(APP_STATE_ACTIONS.TOGGLE_SUCCESSFUL_PROJECT_CREATION_POPUP);
|
|
|
|
|
2020-03-11 17:23:55 +00:00
|
|
|
const wrapper = shallowMount(ProjectCreationSuccessPopup, {
|
2020-02-07 12:07:37 +00:00
|
|
|
store,
|
2020-03-11 17:23:55 +00:00
|
|
|
localVue,
|
2020-02-07 12:07:37 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('closes correctly', async (): Promise<void> => {
|
2020-03-11 17:23:55 +00:00
|
|
|
const wrapper = shallowMount(ProjectCreationSuccessPopup, {
|
2020-02-07 12:07:37 +00:00
|
|
|
store,
|
2020-03-11 17:23:55 +00:00
|
|
|
localVue,
|
2020-02-07 12:07:37 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
await wrapper.find('.project-creation-success-popup__close-cross-container').trigger('click');
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|