storj/web/satellite/tests/unit/project/ProjectCreationSuccessPopup.spec.ts
VitaliiShpital 07da9d17c4 web/satellite: successful project creation popup reworked
Change-Id: I6d94a25a6507d1ab27fa223f042db91cc2cfd4e5
2020-02-19 10:04:23 +00:00

35 lines
1.1 KiB
TypeScript

// 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';
import { mount } from '@vue/test-utils';
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);
const wrapper = mount(ProjectCreationSuccessPopup, {
store,
});
expect(wrapper).toMatchSnapshot();
});
it('closes correctly', async (): Promise<void> => {
const wrapper = mount(ProjectCreationSuccessPopup, {
store,
});
await wrapper.find('.project-creation-success-popup__close-cross-container').trigger('click');
expect(wrapper).toMatchSnapshot();
});
});