gitlab-org--gitlab-foss/spec/frontend/serverless/components/pod_box_spec.js

23 lines
555 B
JavaScript
Raw Normal View History

2019-04-05 22:02:39 -04:00
import { shallowMount } from '@vue/test-utils';
import podBoxComponent from '~/serverless/components/pod_box.vue';
2019-04-05 22:02:39 -04:00
const createComponent = (count) =>
2019-04-05 22:02:39 -04:00
shallowMount(podBoxComponent, {
propsData: {
count,
},
}).vm;
describe('podBoxComponent', () => {
it('should render three boxes', () => {
const count = 3;
const vm = createComponent(count);
const rects = vm.$el.querySelectorAll('rect');
expect(rects.length).toEqual(3);
expect(parseInt(rects[2].getAttribute('x'), 10)).toEqual(40);
vm.$destroy();
});
});