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

const createComponent = (count) =>
  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();
  });
});