summaryrefslogtreecommitdiff
path: root/spec/javascripts/performance_bar
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-10-17 02:13:26 -0500
committerMike Greiling <mike@pixelcog.com>2018-10-17 11:18:17 -0500
commitf666026d71ebefd70219d5078b1f0c83fa01f84d (patch)
treece43feb99c12c21dd266d25de24b1768bac1d459 /spec/javascripts/performance_bar
parent5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff)
downloadgitlab-ce-f666026d71ebefd70219d5078b1f0c83fa01f84d.tar.gz
Prettify all spec files
Diffstat (limited to 'spec/javascripts/performance_bar')
-rw-r--r--spec/javascripts/performance_bar/components/detailed_metric_spec.js8
-rw-r--r--spec/javascripts/performance_bar/components/request_selector_spec.js3
-rw-r--r--spec/javascripts/performance_bar/index_spec.js5
-rw-r--r--spec/javascripts/performance_bar/services/performance_bar_service_spec.js37
4 files changed, 26 insertions, 27 deletions
diff --git a/spec/javascripts/performance_bar/components/detailed_metric_spec.js b/spec/javascripts/performance_bar/components/detailed_metric_spec.js
index c4611dc7662..a3b93280b4b 100644
--- a/spec/javascripts/performance_bar/components/detailed_metric_spec.js
+++ b/spec/javascripts/performance_bar/components/detailed_metric_spec.js
@@ -54,11 +54,9 @@ describe('detailedMetric', () => {
});
it('adds a modal with a table of the details', () => {
- vm.$el
- .querySelectorAll('.performance-bar-modal td strong')
- .forEach((duration, index) => {
- expect(duration.innerText).toContain(requestDetails[index].duration);
- });
+ vm.$el.querySelectorAll('.performance-bar-modal td strong').forEach((duration, index) => {
+ expect(duration.innerText).toContain(requestDetails[index].duration);
+ });
vm.$el
.querySelectorAll('.performance-bar-modal td:nth-child(2)')
diff --git a/spec/javascripts/performance_bar/components/request_selector_spec.js b/spec/javascripts/performance_bar/components/request_selector_spec.js
index 6108a29f8c4..a272e03c0e1 100644
--- a/spec/javascripts/performance_bar/components/request_selector_spec.js
+++ b/spec/javascripts/performance_bar/components/request_selector_spec.js
@@ -11,8 +11,7 @@ describe('request selector', () => {
},
{
id: '789',
- url:
- 'https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1.json?serializer=widget',
+ url: 'https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1.json?serializer=widget',
},
];
diff --git a/spec/javascripts/performance_bar/index_spec.js b/spec/javascripts/performance_bar/index_spec.js
index 1784bd64adb..1444d1bb3cb 100644
--- a/spec/javascripts/performance_bar/index_spec.js
+++ b/spec/javascripts/performance_bar/index_spec.js
@@ -63,10 +63,7 @@ describe('performance bar wrapper', () => {
it('adds the request immediately', () => {
vm.loadRequestDetails('123', 'https://gitlab.com/');
- expect(vm.store.addRequest).toHaveBeenCalledWith(
- '123',
- 'https://gitlab.com/',
- );
+ expect(vm.store.addRequest).toHaveBeenCalledWith('123', 'https://gitlab.com/');
});
it('makes an HTTP request for the request details', () => {
diff --git a/spec/javascripts/performance_bar/services/performance_bar_service_spec.js b/spec/javascripts/performance_bar/services/performance_bar_service_spec.js
index bc6947dbe81..cfec4b779e4 100644
--- a/spec/javascripts/performance_bar/services/performance_bar_service_spec.js
+++ b/spec/javascripts/performance_bar/services/performance_bar_service_spec.js
@@ -8,28 +8,34 @@ describe('PerformanceBarService', () => {
}
it('returns false when the request URL is the peek URL', () => {
- expect(fireCallback({ headers: { 'x-request-id': '123' }, url: '/peek' }, '/peek'))
- .toBeFalsy();
+ expect(
+ fireCallback({ headers: { 'x-request-id': '123' }, url: '/peek' }, '/peek'),
+ ).toBeFalsy();
});
it('returns false when there is no request ID', () => {
- expect(fireCallback({ headers: {}, url: '/request' }, '/peek'))
- .toBeFalsy();
+ expect(fireCallback({ headers: {}, url: '/request' }, '/peek')).toBeFalsy();
});
it('returns false when the request is an API request', () => {
- expect(fireCallback({ headers: { 'x-request-id': '123' }, url: '/api/' }, '/peek'))
- .toBeFalsy();
+ expect(
+ fireCallback({ headers: { 'x-request-id': '123' }, url: '/api/' }, '/peek'),
+ ).toBeFalsy();
});
it('returns false when the response is from the cache', () => {
- expect(fireCallback({ headers: { 'x-request-id': '123', 'x-gitlab-from-cache': 'true' }, url: '/request' }, '/peek'))
- .toBeFalsy();
+ expect(
+ fireCallback(
+ { headers: { 'x-request-id': '123', 'x-gitlab-from-cache': 'true' }, url: '/request' },
+ '/peek',
+ ),
+ ).toBeFalsy();
});
it('returns true when all conditions are met', () => {
- expect(fireCallback({ headers: { 'x-request-id': '123' }, url: '/request' }, '/peek'))
- .toBeTruthy();
+ expect(
+ fireCallback({ headers: { 'x-request-id': '123' }, url: '/request' }, '/peek'),
+ ).toBeTruthy();
});
});
@@ -39,8 +45,7 @@ describe('PerformanceBarService', () => {
}
it('gets the request ID from the headers', () => {
- expect(requestId({ headers: { 'x-request-id': '123' } }, '/peek'))
- .toEqual('123');
+ expect(requestId({ headers: { 'x-request-id': '123' } }, '/peek')).toEqual('123');
});
});
@@ -50,13 +55,13 @@ describe('PerformanceBarService', () => {
}
it('gets the request URL from the response object', () => {
- expect(requestUrl({ headers: {}, url: '/request' }, '/peek'))
- .toEqual('/request');
+ expect(requestUrl({ headers: {}, url: '/request' }, '/peek')).toEqual('/request');
});
it('gets the request URL from response.config if present', () => {
- expect(requestUrl({ headers: {}, config: { url: '/config-url' }, url: '/request' }, '/peek'))
- .toEqual('/config-url');
+ expect(
+ requestUrl({ headers: {}, config: { url: '/config-url' }, url: '/request' }, '/peek'),
+ ).toEqual('/config-url');
});
});
});