2020-03-18 17:07:29 +00:00
|
|
|
// 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,
|
2021-06-09 16:13:19 +01:00
|
|
|
isDataFetching: false,
|
2020-03-18 17:07:29 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders correctly if used > limit', (): void => {
|
|
|
|
const wrapper = shallowMount(UsageArea, {
|
|
|
|
localVue,
|
|
|
|
propsData: {
|
|
|
|
title: 'test Title',
|
|
|
|
used: 1000000000,
|
|
|
|
limit: 500000000,
|
2021-06-09 16:13:19 +01:00
|
|
|
isDataFetching: false,
|
2020-03-18 17:07:29 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
expect(wrapper.find('.usage-area__remaining').text()).toMatch('0 Bytes Remaining');
|
|
|
|
});
|
|
|
|
});
|