2020-09-28 14:44:01 +01:00
|
|
|
// Copyright (C) 2020 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
import Vuex from 'vuex';
|
|
|
|
|
|
|
|
import ProjectSummary from '@/components/project/summary/ProjectSummary.vue';
|
|
|
|
|
2020-12-06 23:32:35 +00:00
|
|
|
import { makeAccessGrantsModule } from '@/store/modules/accessGrants';
|
2020-09-28 14:44:01 +01:00
|
|
|
import { makeBucketsModule } from '@/store/modules/buckets';
|
|
|
|
import { makePaymentsModule } from '@/store/modules/payments';
|
|
|
|
import { makeProjectMembersModule } from '@/store/modules/projectMembers';
|
|
|
|
import { makeProjectsModule } from '@/store/modules/projects';
|
|
|
|
import { NotificatorPlugin } from '@/utils/plugins/notificator';
|
|
|
|
import { createLocalVue, mount } from '@vue/test-utils';
|
|
|
|
|
2020-12-06 23:32:35 +00:00
|
|
|
import { AccessGrantsMock } from '../../mock/api/accessGrants';
|
2020-09-28 14:44:01 +01:00
|
|
|
import { BucketsMock } from '../../mock/api/buckets';
|
|
|
|
import { PaymentsMock } from '../../mock/api/payments';
|
|
|
|
import { ProjectMembersApiMock } from '../../mock/api/projectMembers';
|
|
|
|
import { ProjectsApiMock } from '../../mock/api/projects';
|
|
|
|
|
|
|
|
const notificationPlugin = new NotificatorPlugin();
|
|
|
|
const localVue = createLocalVue();
|
|
|
|
|
|
|
|
localVue.use(Vuex);
|
|
|
|
localVue.use(notificationPlugin);
|
|
|
|
|
|
|
|
localVue.filter('centsToDollars', (cents: number): string => {
|
|
|
|
return `$${(cents / 100).toFixed(2)}`;
|
|
|
|
});
|
|
|
|
|
|
|
|
const projectsApi = new ProjectsApiMock();
|
|
|
|
const projectsModule = makeProjectsModule(projectsApi);
|
|
|
|
const paymentsApi = new PaymentsMock();
|
|
|
|
const paymentsModule = makePaymentsModule(paymentsApi);
|
|
|
|
const bucketsApi = new BucketsMock();
|
|
|
|
const bucketUsageModule = makeBucketsModule(bucketsApi);
|
2020-12-06 23:32:35 +00:00
|
|
|
const accessGrantsApi = new AccessGrantsMock();
|
|
|
|
const accessGrantsModule = makeAccessGrantsModule(accessGrantsApi);
|
2020-09-28 14:44:01 +01:00
|
|
|
const projectMembersApi = new ProjectMembersApiMock();
|
|
|
|
const projectMembersModule = makeProjectMembersModule(projectMembersApi);
|
|
|
|
|
2020-12-06 23:32:35 +00:00
|
|
|
const store = new Vuex.Store({ modules: { projectsModule, paymentsModule, bucketUsageModule, projectMembersModule, accessGrantsModule }});
|
2020-09-28 14:44:01 +01:00
|
|
|
|
|
|
|
describe('ProjectSummary.vue', (): void => {
|
|
|
|
it('renders correctly', (): void => {
|
|
|
|
const wrapper = mount(ProjectSummary, {
|
|
|
|
store,
|
|
|
|
localVue,
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|