storj/web/satellite/tests/unit/project/usage/UsageArea.spec.ts
VitaliiShpital 506582e208 web/satellite: project overview page removed, dashboard page implemented
Change-Id: Id56425fe38296250e5814a0f02a554cdd73b2330
2020-03-26 17:15:14 +00:00

38 lines
1.0 KiB
TypeScript

// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
import UsageArea from '@/components/project/usage/UsageArea.vue';
import { createLocalVue, shallowMount } from '@vue/test-utils';
const localVue = createLocalVue();
describe('UsageArea.vue', () => {
it('renders correctly', (): void => {
const wrapper = shallowMount(UsageArea, {
localVue,
propsData: {
title: 'test Title',
used: 500000000,
limit: 1000000000,
},
});
expect(wrapper).toMatchSnapshot();
});
it('renders correctly if used > limit', (): void => {
const wrapper = shallowMount(UsageArea, {
localVue,
propsData: {
title: 'test Title',
used: 1000000000,
limit: 500000000,
},
});
expect(wrapper).toMatchSnapshot();
expect(wrapper.find('.usage-area__remaining').text()).toMatch('0 Bytes Remaining');
});
});