2019-07-07 11:18:12 +05:30
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2020-01-01 13:55:28 +05:30
|
|
|
import podBoxComponent from '~/serverless/components/pod_box.vue';
|
2019-07-07 11:18:12 +05:30
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
const createComponent = (count) =>
|
2019-07-07 11:18:12 +05:30
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|