b57819f590
WHAT: take pricing from config instead of hardcoding WHY: bakeoff Change-Id: Id8209f0905a9105c1f5796165e279acf31563c65
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
// Copyright (C) 2020 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import Vuex from 'vuex';
|
|
|
|
import AddPaymentStep from '@/components/onboardingTour/steps/AddPaymentStep.vue';
|
|
|
|
import { PaymentsHttpApi } from '@/api/payments';
|
|
import { makePaymentsModule } from '@/store/modules/payments';
|
|
import { makeProjectsModule } from '@/store/modules/projects';
|
|
import { MetaUtils } from '@/utils/meta';
|
|
import { createLocalVue, shallowMount } from '@vue/test-utils';
|
|
|
|
import { ProjectsApiMock } from '../../mock/api/projects';
|
|
|
|
const localVue = createLocalVue();
|
|
localVue.use(Vuex);
|
|
const projectsApi = new ProjectsApiMock();
|
|
const projectsModule = makeProjectsModule(projectsApi);
|
|
const paymentsApi = new PaymentsHttpApi();
|
|
const paymentsModule = makePaymentsModule(paymentsApi);
|
|
|
|
const store = new Vuex.Store({ modules: { projectsModule, paymentsModule }});
|
|
|
|
jest.mock('@/utils/meta');
|
|
|
|
describe('AddPaymentStep.vue', () => {
|
|
it('renders correctly', async (): Promise<void> => {
|
|
MetaUtils.getMetaContent = jest.fn().mockReturnValue('1');
|
|
|
|
const wrapper = shallowMount(AddPaymentStep, {
|
|
store,
|
|
localVue,
|
|
});
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
await wrapper.find('.payment-step__methods-container__title-area__options-area__token').trigger('click');
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|