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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-07 09:10:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-07 09:10:43 +0300
commita158bebe03b366b6463af181b9ee6f6c2b3850a3 (patch)
treeae65950cccfa3d99292a5c083df0cf786c74dd2b /spec/frontend/pipelines
parent170765911848f0ad68e0f26f6413dd770d36f364 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/pipelines')
-rw-r--r--spec/frontend/pipelines/graph_shared/links_layer_spec.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/frontend/pipelines/graph_shared/links_layer_spec.js b/spec/frontend/pipelines/graph_shared/links_layer_spec.js
index 511aba0acaf..932a19f2f00 100644
--- a/spec/frontend/pipelines/graph_shared/links_layer_spec.js
+++ b/spec/frontend/pipelines/graph_shared/links_layer_spec.js
@@ -96,23 +96,19 @@ describe('links layer component', () => {
});
describe('performance metrics', () => {
+ const metricsPath = '/root/project/-/ci/prometheus_metrics/histograms.json';
let markAndMeasure;
let reportToSentry;
let reportPerformance;
let mock;
beforeEach(() => {
- mock = new MockAdapter(axios);
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => cb());
markAndMeasure = jest.spyOn(perfUtils, 'performanceMarkAndMeasure');
reportToSentry = jest.spyOn(sentryUtils, 'reportToSentry');
reportPerformance = jest.spyOn(Api, 'reportPerformance');
});
- afterEach(() => {
- mock.restore();
- });
-
describe('with no metrics config object', () => {
beforeEach(() => {
createComponent();
@@ -164,7 +160,6 @@ describe('links layer component', () => {
});
describe('with metrics path and collect set to true', () => {
- const metricsPath = '/root/project/-/ci/prometheus_metrics/histograms.json';
const duration = 875;
const numLinks = 7;
const totalGroups = 8;
@@ -204,6 +199,9 @@ describe('links layer component', () => {
describe('with duration and no error', () => {
beforeEach(() => {
+ mock = new MockAdapter(axios);
+ mock.onPost(metricsPath).reply(200, {});
+
jest.spyOn(window.performance, 'getEntriesByName').mockImplementation(() => {
return [{ duration }];
});
@@ -218,6 +216,10 @@ describe('links layer component', () => {
});
});
+ afterEach(() => {
+ mock.restore();
+ });
+
it('it calls reportPerformance with expected arguments', () => {
expect(markAndMeasure).toHaveBeenCalled();
expect(reportPerformance).toHaveBeenCalled();