2020-08-31 12:54:40 +01:00
|
|
|
// Copyright (C) 2020 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
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();
|
2023-04-13 13:04:26 +01:00
|
|
|
localVue.use(new NotificatorPlugin());
|
2022-04-07 12:04:24 +01:00
|
|
|
|
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
|
|
|
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
|
|
|
localVue,
|
|
|
|
});
|
|
|
|
|
|
|
|
await wrapper.vm.setProjectName('testName');
|
|
|
|
|
|
|
|
expect(wrapper.findAll('.disabled').length).toBe(0);
|
|
|
|
});
|
|
|
|
});
|