storj/web/multinode/tests/unit/components/payouts/PayoutPeriodCalendarButton.spec.ts
NickolaiYurchenko e0f3166343 web/multinode: store and payouts components tests added
WHAT: unit tests for vue components and vuex store and environment for it

WHY: to cover frontend part with tests

Change-Id: I2aeaadb200176d4ba0a1406068304785e95d92cd
2021-05-14 12:45:10 +00:00

38 lines
1.0 KiB
TypeScript

// Copyright (C) 2021 Storj Labs, Inc.
// See LICENSE for copying information.
import Vuex from 'vuex';
import PayoutPeriodCalendarButton from '@/app/components/payouts/PayoutPeriodCalendarButton.vue';
import { createLocalVue, shallowMount } from '@vue/test-utils';
const localVue = createLocalVue();
localVue.use(Vuex);
describe('PayoutPeriodCalendarButton', (): void => {
it('renders correctly', (): void => {
const wrapper = shallowMount(PayoutPeriodCalendarButton, {
localVue,
propsData: {
period: 'April, 2021',
},
});
expect(wrapper).toMatchSnapshot();
});
it('triggers open calendar correctly', async (): Promise<void> => {
const wrapper = shallowMount(PayoutPeriodCalendarButton, {
localVue,
propsData: {
period: 'April, 2021',
},
});
await wrapper.find('.calendar-button').trigger('click');
expect(wrapper).toMatchSnapshot();
});
});