diff options
Diffstat (limited to 'spec/frontend/pipelines/utils_spec.js')
-rw-r--r-- | spec/frontend/pipelines/utils_spec.js | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/spec/frontend/pipelines/utils_spec.js b/spec/frontend/pipelines/utils_spec.js index a82390fae22..1c23a7e4fcf 100644 --- a/spec/frontend/pipelines/utils_spec.js +++ b/spec/frontend/pipelines/utils_spec.js @@ -8,14 +8,10 @@ import { removeOrphanNodes, getMaxNodes, } from '~/pipelines/components/parsing_utils'; -import { createNodeDict, calculateJobStats, calculateSlowestFiveJobs } from '~/pipelines/utils'; +import { createNodeDict } from '~/pipelines/utils'; import { mockParsedGraphQLNodes, missingJob } from './components/dag/mock_data'; -import { - generateResponse, - mockPipelineResponse, - mockPerformanceInsightsResponse, -} from './graph/mock_data'; +import { generateResponse, mockPipelineResponse } from './graph/mock_data'; describe('DAG visualization parsing utilities', () => { const nodeDict = createNodeDict(mockParsedGraphQLNodes); @@ -162,40 +158,4 @@ describe('DAG visualization parsing utilities', () => { expect(columns).toMatchSnapshot(); }); }); - - describe('performance insights', () => { - const { - data: { - project: { - pipeline: { jobs }, - }, - }, - } = mockPerformanceInsightsResponse; - - describe('calculateJobStats', () => { - const expectedJob = jobs.nodes[0]; - - it('returns the job that spent this longest time queued', () => { - expect(calculateJobStats(jobs, 'queuedDuration')).toEqual(expectedJob); - }); - - it('returns the job that was executed last', () => { - expect(calculateJobStats(jobs, 'startedAt')).toEqual(expectedJob); - }); - }); - - describe('calculateSlowestFiveJobs', () => { - it('returns the slowest five jobs of the pipeline', () => { - const expectedJobs = [ - jobs.nodes[9], - jobs.nodes[1], - jobs.nodes[5], - jobs.nodes[7], - jobs.nodes[8], - ]; - - expect(calculateSlowestFiveJobs(jobs)).toEqual(expectedJobs); - }); - }); - }); }); |