debian-mirror-gitlab/spec/frontend/jobs/components/log/duration_badge_spec.js
2019-12-04 20:38:33 +05:30

31 lines
599 B
JavaScript

import { shallowMount } from '@vue/test-utils';
import DurationBadge from '~/jobs/components/log/duration_badge.vue';
describe('Job Log Duration Badge', () => {
let wrapper;
const data = {
duration: '00:30:01',
};
const createComponent = (props = {}) => {
wrapper = shallowMount(DurationBadge, {
sync: false,
propsData: {
...props,
},
});
};
beforeEach(() => {
createComponent(data);
});
afterEach(() => {
wrapper.destroy();
});
it('renders provided duration', () => {
expect(wrapper.text()).toBe(data.duration);
});
});