2020-08-31 12:54:40 +01:00
|
|
|
// Copyright (C) 2020 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
import Vuex from 'vuex';
|
2022-09-29 00:51:19 +01:00
|
|
|
import { createLocalVue, shallowMount } from '@vue/test-utils';
|
2020-08-31 12:54:40 +01:00
|
|
|
|
|
|
|
import { NotificatorPlugin } from '@/utils/plugins/notificator';
|
|
|
|
|
2022-09-08 15:11:09 +01:00
|
|
|
import CreateProject from '@/components/project/CreateProject.vue';
|
2020-08-31 12:54:40 +01:00
|
|
|
|
|
|
|
const localVue = createLocalVue();
|
2022-04-07 12:04:24 +01:00
|
|
|
|
2020-08-31 12:54:40 +01:00
|
|
|
localVue.use(Vuex);
|
|
|
|
|
2023-04-13 12:41:03 +01:00
|
|
|
const store = new Vuex.Store({});
|
2020-08-31 12:54:40 +01:00
|
|
|
|
2022-04-07 12:04:24 +01:00
|
|
|
localVue.use(new NotificatorPlugin(store));
|
|
|
|
|
2020-08-31 12:54:40 +01:00
|
|
|
describe('CreateProject.vue', (): void => {
|
|
|
|
it('renders correctly', (): void => {
|
2022-09-29 00:51:19 +01:00
|
|
|
const wrapper = shallowMount<CreateProject>(CreateProject, {
|
2020-08-31 12:54:40 +01:00
|
|
|
store,
|
|
|
|
localVue,
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders correctly with project name', async (): Promise<void> => {
|
2022-09-29 00:51:19 +01:00
|
|
|
const wrapper = shallowMount<CreateProject>(CreateProject, {
|
2020-08-31 12:54:40 +01:00
|
|
|
store,
|
|
|
|
localVue,
|
|
|
|
});
|
|
|
|
|
|
|
|
await wrapper.vm.setProjectName('testName');
|
|
|
|
|
|
|
|
expect(wrapper.findAll('.disabled').length).toBe(0);
|
|
|
|
});
|
|
|
|
});
|