2019-04-05 22:02:39 -04:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2019-12-09 07:07:58 -05:00
|
|
|
import podBoxComponent from '~/serverless/components/pod_box.vue';
|
2019-04-05 22:02:39 -04:00
|
|
|
|
2020-12-23 19:10:25 -05: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();
|
|
|
|
});
|
|
|
|
});
|