59d85aab5b
WHAT: Now project amount limit is taken from users db instead of config. But if db value is 0 then default config value will be used instead. WHY: this will allow us to change user's project limit by changing db value. Change-Id: I9edcd0bf9eaae5fe40e90a44cac82d9ce8519274
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
// Copyright (C) 2020 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import Vuex from 'vuex';
|
|
|
|
import ProjectDashboard from '@/components/project/ProjectDashboard.vue';
|
|
|
|
import { appStateModule } from '@/store/modules/appState';
|
|
import { makeProjectsModule, PROJECTS_MUTATIONS } from '@/store/modules/projects';
|
|
import { makeUsersModule } from '@/store/modules/users';
|
|
import { Project } from '@/types/projects';
|
|
import { SegmentioPlugin } from '@/utils/plugins/segment';
|
|
import { createLocalVue, shallowMount } from '@vue/test-utils';
|
|
|
|
import { ProjectsApiMock } from '../mock/api/projects';
|
|
import { UsersApiMock } from '../mock/api/users';
|
|
|
|
const segmentioPlugin = new SegmentioPlugin();
|
|
const localVue = createLocalVue();
|
|
localVue.use(Vuex);
|
|
localVue.use(segmentioPlugin);
|
|
|
|
const usersApi = new UsersApiMock();
|
|
const usersModule = makeUsersModule(usersApi);
|
|
const projectsApi = new ProjectsApiMock();
|
|
const projectsModule = makeProjectsModule(projectsApi);
|
|
|
|
const store = new Vuex.Store({ modules: { appStateModule, usersModule, projectsModule }});
|
|
const project = new Project('id', 'test', 'test', 'test', 'ownedId', false);
|
|
|
|
describe('ProjectDashboard.vue', () => {
|
|
it('renders correctly', (): void => {
|
|
store.commit(PROJECTS_MUTATIONS.ADD, project);
|
|
store.commit(PROJECTS_MUTATIONS.SELECT_PROJECT, project.id);
|
|
|
|
const wrapper = shallowMount(ProjectDashboard, {
|
|
store,
|
|
localVue,
|
|
});
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|