summaryrefslogtreecommitdiff
path: root/spec/javascripts/performance_bar/components/performance_bar_app_spec.js
blob: 7926db44429d48fcf7447da23fe11893abe59aa5 (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
import Vue from 'vue';
import performanceBarApp from '~/performance_bar/components/performance_bar_app.vue';
import PerformanceBarStore from '~/performance_bar/stores/performance_bar_store';

import mountComponent from 'spec/helpers/vue_mount_component_helper';

describe('performance bar app', () => {
  let vm;

  beforeEach(() => {
    const store = new PerformanceBarStore();

    vm = mountComponent(Vue.extend(performanceBarApp), {
      store,
      env: 'development',
      requestId: '123',
      peekUrl: '/-/peek/results',
      profileUrl: '?lineprofiler=true',
    });
  });

  afterEach(() => {
    vm.$destroy();
  });

  it('sets the class to match the environment', () => {
    expect(vm.$el.getAttribute('class')).toContain('development');
  });
});