2020-04-22 17:21:12 +01:00
|
|
|
// Copyright (C) 2020 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
import ProgressBar from '@/components/onboardingTour/ProgressBar.vue';
|
|
|
|
|
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
|
|
|
|
describe('ProgressBar.vue', () => {
|
2020-07-10 14:05:17 +01:00
|
|
|
it('renders correctly if paywall is enabled', (): void => {
|
|
|
|
const wrapper = mount(ProgressBar, {
|
|
|
|
propsData: {
|
|
|
|
isPaywallEnabled: true,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders correctly if paywall is disabled', (): void => {
|
|
|
|
const wrapper = mount(ProgressBar, {
|
|
|
|
propsData: {
|
|
|
|
isPaywallEnabled: false,
|
|
|
|
},
|
|
|
|
});
|
2020-04-22 17:21:12 +01:00
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
2020-04-30 21:35:09 +01:00
|
|
|
|
2020-07-03 11:35:27 +01:00
|
|
|
it('renders correctly if add payment step is completed', (): void => {
|
2020-04-30 21:35:09 +01:00
|
|
|
const wrapper = mount(ProgressBar, {
|
|
|
|
propsData: {
|
2020-07-03 11:35:27 +01:00
|
|
|
isAddPaymentStep: true,
|
2020-07-10 14:05:17 +01:00
|
|
|
isPaywallEnabled: true,
|
2020-04-30 21:35:09 +01:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper.findAll('.completed-step').length).toBe(1);
|
|
|
|
expect(wrapper.findAll('.completed-font-color').length).toBe(1);
|
|
|
|
});
|
|
|
|
|
2020-07-03 11:35:27 +01:00
|
|
|
it('renders correctly if create project step is completed', (): void => {
|
2020-04-30 21:35:09 +01:00
|
|
|
const wrapper = mount(ProgressBar, {
|
|
|
|
propsData: {
|
2020-07-03 11:35:27 +01:00
|
|
|
isCreateProjectStep: true,
|
2020-07-10 14:05:17 +01:00
|
|
|
isPaywallEnabled: true,
|
2020-04-30 21:35:09 +01:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper.findAll('.completed-step').length).toBe(3);
|
|
|
|
expect(wrapper.findAll('.completed-font-color').length).toBe(2);
|
|
|
|
});
|
|
|
|
|
2020-07-03 11:35:27 +01:00
|
|
|
it('renders correctly if create api key step is completed', (): void => {
|
2020-04-30 21:35:09 +01:00
|
|
|
const wrapper = mount(ProgressBar, {
|
|
|
|
propsData: {
|
2020-07-03 11:35:27 +01:00
|
|
|
isCreateApiKeyStep: true,
|
2020-07-10 14:05:17 +01:00
|
|
|
isPaywallEnabled: true,
|
2020-04-30 21:35:09 +01:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper.findAll('.completed-step').length).toBe(5);
|
|
|
|
expect(wrapper.findAll('.completed-font-color').length).toBe(3);
|
|
|
|
});
|
2020-07-03 11:35:27 +01:00
|
|
|
|
|
|
|
it('renders correctly if upload data step is completed', (): void => {
|
|
|
|
const wrapper = mount(ProgressBar, {
|
|
|
|
propsData: {
|
|
|
|
isUploadDataStep: true,
|
2020-07-10 14:05:17 +01:00
|
|
|
isPaywallEnabled: true,
|
2020-07-03 11:35:27 +01:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper.findAll('.completed-step').length).toBe(7);
|
|
|
|
expect(wrapper.findAll('.completed-font-color').length).toBe(4);
|
|
|
|
});
|
2020-04-22 17:21:12 +01:00
|
|
|
});
|