2019-12-09 12:07:58 +00:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2019-09-30 21:06:41 +00:00
|
|
|
import PerformanceBarApp from '~/performance_bar/components/performance_bar_app.vue';
|
|
|
|
import PerformanceBarStore from '~/performance_bar/stores/performance_bar_store';
|
|
|
|
|
|
|
|
describe('performance bar app', () => {
|
|
|
|
const store = new PerformanceBarStore();
|
|
|
|
const wrapper = shallowMount(PerformanceBarApp, {
|
|
|
|
propsData: {
|
|
|
|
store,
|
|
|
|
env: 'development',
|
|
|
|
requestId: '123',
|
2021-02-18 12:09:34 +00:00
|
|
|
statsUrl: 'https://log.gprd.gitlab.net/app/dashboards#/view/',
|
2019-09-30 21:06:41 +00:00
|
|
|
peekUrl: '/-/peek/results',
|
|
|
|
profileUrl: '?lineprofiler=true',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
it('sets the class to match the environment', () => {
|
|
|
|
expect(wrapper.element.getAttribute('class')).toContain('development');
|
|
|
|
});
|
2022-03-11 21:07:59 +00:00
|
|
|
|
|
|
|
describe('changeCurrentRequest', () => {
|
|
|
|
it('emits a change-request event', () => {
|
|
|
|
expect(wrapper.emitted('change-request')).toBeUndefined();
|
|
|
|
|
|
|
|
wrapper.vm.changeCurrentRequest('123');
|
|
|
|
|
|
|
|
expect(wrapper.emitted('change-request')).toBeDefined();
|
|
|
|
expect(wrapper.emitted('change-request')[0]).toEqual(['123']);
|
|
|
|
});
|
|
|
|
});
|
2019-09-30 21:06:41 +00:00
|
|
|
});
|