storj/web/satellite/tests/unit/onboardingTour/steps/UploadDataStep.spec.ts
VitaliiShpital 2284008b8c web/satellite: onboarding tour: api keys and upload data steps
Change-Id: I8ffa6d688a22c1568495a7e0e176096cadcd6eaa
2020-05-04 13:26:12 +00:00

37 lines
944 B
TypeScript

// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
import sinon from 'sinon';
import UploadDataStep from '@/components/onboardingTour/steps/UploadDataStep.vue';
import { router } from '@/router';
import { createLocalVue, mount } from '@vue/test-utils';
const localVue = createLocalVue();
describe('UploadDataStep.vue', () => {
it('renders correctly', (): void => {
const wrapper = mount(UploadDataStep, {
localVue,
});
expect(wrapper).toMatchSnapshot();
});
it('button click works correctly', async (): Promise<void> => {
const clickSpy = sinon.spy();
const wrapper = mount(UploadDataStep, {
localVue,
router,
methods: {
onButtonClick: clickSpy,
},
});
await wrapper.find('.go-to-button').trigger('click');
expect(clickSpy.callCount).toBe(1);
});
});