summaryrefslogtreecommitdiff
path: root/spec/frontend/serverless/components/pod_box_spec.js
blob: 8563d29c56bada413580cc94ab4b8b458b8d4cc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { shallowMount } from '@vue/test-utils';
import podBoxComponent from '~/serverless/components/pod_box.vue';

const createComponent = count =>
  shallowMount(podBoxComponent, {
    propsData: {
      count,
    },
    sync: false,
  }).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();
  });
});