storj/web/satellite/tests/unit/account/billing/freeCredits/CreditsItem.spec.ts
VitaliiShpital d4bde7848e web/satellite: coupon status replaced with expiration date
WHAT:
coupon status view replaced with month and year of coupon expiration date

WHY:
better User experience

Change-Id: I67abe14418aeb876a524de5e3f3c027407343100
2020-07-13 18:02:44 +00:00

28 lines
886 B
TypeScript

// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
import CreditsItem from '@/components/account/billing/freeCredits/CreditsItem.vue';
import { PaymentsHistoryItem, PaymentsHistoryItemType } from '@/types/payments';
import { createLocalVue, mount } from '@vue/test-utils';
const localVue = createLocalVue();
const coupon = new PaymentsHistoryItem('testId', 'desc', 275, 0, 'Active', '', new Date(1), new Date(1), PaymentsHistoryItemType.Coupon, 275);
localVue.filter('centsToDollars', (cents: number): string => {
return `$${(cents / 100).toFixed(2)}`;
});
describe('CreditsItem', (): void => {
it('renders correctly', (): void => {
const wrapper = mount(CreditsItem, {
localVue,
propsData: {
creditsItem: coupon,
},
});
expect(wrapper).toMatchSnapshot();
});
});