4ae05afb24
Change-Id: I03f14995d5315068582d357375365f0af8d63b8b
40 lines
1023 B
TypeScript
40 lines
1023 B
TypeScript
// Copyright (C) 2020 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import Vuex from 'vuex';
|
|
import { createLocalVue, shallowMount } from '@vue/test-utils';
|
|
|
|
import { NotificatorPlugin } from '@/utils/plugins/notificator';
|
|
|
|
import CreateProject from '@/components/project/CreateProject.vue';
|
|
|
|
const localVue = createLocalVue();
|
|
|
|
localVue.use(Vuex);
|
|
|
|
const store = new Vuex.Store({});
|
|
|
|
localVue.use(new NotificatorPlugin());
|
|
|
|
describe('CreateProject.vue', (): void => {
|
|
it('renders correctly', (): void => {
|
|
const wrapper = shallowMount<CreateProject>(CreateProject, {
|
|
store,
|
|
localVue,
|
|
});
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
|
|
it('renders correctly with project name', async (): Promise<void> => {
|
|
const wrapper = shallowMount<CreateProject>(CreateProject, {
|
|
store,
|
|
localVue,
|
|
});
|
|
|
|
await wrapper.vm.setProjectName('testName');
|
|
|
|
expect(wrapper.findAll('.disabled').length).toBe(0);
|
|
});
|
|
});
|