Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pod_box_spec.js « components « serverless « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 495d11bd9ec3e7db2a4450ccd9c33ea19146af0d (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();
  });
});