summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_shared/components/tabs/tab_spec.js
blob: 8437fe377388b761099c53d4c0b34d888b9bfb24 (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 'spec/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();
    });
  });
});