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

tab_spec.js « tabs « components « vue_shared « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee0c983c76475c633733f50f87024ba0f31c3253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Vue from 'vue';
import mountComponent from 'helpers/vue_mount_component_helper';
import Tab from '~/vue_shared/components/tabs/tab.vue';

describe('Tab component', () => {
  const Component = Vue.extend(Tab);
  let vm;

  beforeEach(() => {
    vm = mountComponent(Component);
  });

  it('sets localActive to equal active', (done) => {
    vm.active = true;

    vm.$nextTick(() => {
      expect(vm.localActive).toBe(true);

      done();
    });
  });

  it('sets active class', (done) => {
    vm.active = true;

    vm.$nextTick(() => {
      expect(vm.$el.classList).toContain('active');

      done();
    });
  });
});