2020-03-18 17:07:29 +00:00
|
|
|
// Copyright (C) 2020 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
import VBar from '@/components/common/VBar.vue';
|
|
|
|
|
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
|
|
|
|
describe('VBar.vue', () => {
|
|
|
|
it('renders correctly', () => {
|
|
|
|
const wrapper = mount(VBar, {
|
|
|
|
propsData: {
|
|
|
|
current: 500,
|
|
|
|
max: 1000,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders correctly if current > max', () => {
|
|
|
|
const wrapper = mount(VBar, {
|
|
|
|
propsData: {
|
|
|
|
current: 1000,
|
|
|
|
max: 500,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
2022-04-07 12:04:24 +01:00
|
|
|
|
|
|
|
const el = wrapper.find('.bar-container__fill').element as HTMLElement;
|
|
|
|
expect(el.style.width).toMatch('100%');
|
2020-03-18 17:07:29 +00:00
|
|
|
});
|
|
|
|
});
|