summaryrefslogtreecommitdiff
path: root/spec/frontend/commit/commit_box_pipeline_mini_graph_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/commit/commit_box_pipeline_mini_graph_spec.js')
-rw-r--r--spec/frontend/commit/commit_box_pipeline_mini_graph_spec.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/frontend/commit/commit_box_pipeline_mini_graph_spec.js b/spec/frontend/commit/commit_box_pipeline_mini_graph_spec.js
index 16737003fa0..debd10de118 100644
--- a/spec/frontend/commit/commit_box_pipeline_mini_graph_spec.js
+++ b/spec/frontend/commit/commit_box_pipeline_mini_graph_spec.js
@@ -141,6 +141,16 @@ describe('Commit box pipeline mini graph', () => {
expect(upstreamPipeline).toEqual(null);
});
+ it('should render the latest downstream pipeline only', async () => {
+ createComponent(downstreamHandler);
+
+ await waitForPromises();
+
+ const downstreamPipelines = findPipelineMiniGraph().props('downstreamPipelines');
+
+ expect(downstreamPipelines).toHaveLength(1);
+ });
+
it('should pass the pipeline path prop for the counter badge', async () => {
createComponent(downstreamHandler);
@@ -173,7 +183,14 @@ describe('Commit box pipeline mini graph', () => {
const upstreamPipeline = findPipelineMiniGraph().props('upstreamPipeline');
expect(upstreamPipeline).toEqual(samplePipeline);
- expect(downstreamPipelines).toEqual(expect.arrayContaining([samplePipeline]));
+ expect(downstreamPipelines).toEqual(
+ expect.arrayContaining([
+ {
+ ...samplePipeline,
+ sourceJob: expect.any(Object),
+ },
+ ]),
+ );
});
});