Commit 9b029853 authored by pburdette's avatar pburdette

Fix downstream counter badge link

Ensure the counter badge links to
the pipeline path by passing the
prop.

Changelog: fixed
EE: true
parent 04a281bc
......@@ -212,6 +212,7 @@ export default {
<linked-pipelines-mini-list
v-if="item.triggered.length"
:triggered="item.triggered"
:pipeline-path="item.path"
data-testid="mini-graph-downstream"
/>
</div>
......
......@@ -87,6 +87,7 @@ export default {
<linked-pipelines-mini-list
v-if="hasDownstream"
:triggered="downstreamPipelines"
:pipeline-path="pipeline.path"
data-testid="commit-box-mini-graph-downstream"
/>
</div>
......
query getLinkedPipelines($fullPath: ID!, $iid: ID!) {
project(fullPath: $fullPath) {
pipeline(iid: $iid) {
path
downstream {
nodes {
id
......
......@@ -81,6 +81,16 @@ describe('Commit box pipeline mini graph', () => {
expect(findMiniGraph().exists()).toBe(true);
});
it('should pass the pipeline path prop for the counter badge', async () => {
createComponent(downstreamHandler);
await waitForPromises();
const expectedPath = mockDownstreamQueryResponse.data.project.pipeline.path;
expect(findDownstream().props('pipelinePath')).toBe(expectedPath);
});
describe.each`
handler | downstreamRenders | upstreamRenders
${downstreamHandler} | ${true} | ${false}
......
......@@ -2,6 +2,7 @@ export const mockDownstreamQueryResponse = {
data: {
project: {
pipeline: {
path: '/root/ci-project/-/pipelines/790',
downstream: {
nodes: [
{
......@@ -30,6 +31,7 @@ export const mockUpstreamQueryResponse = {
data: {
project: {
pipeline: {
path: '/root/ci-project/-/pipelines/790',
downstream: {
nodes: [],
__typename: 'PipelineConnection',
......@@ -56,6 +58,7 @@ export const mockUpstreamDownstreamQueryResponse = {
data: {
project: {
pipeline: {
path: '/root/ci-project/-/pipelines/790',
downstream: {
nodes: [
{
......
......@@ -77,6 +77,10 @@ describe('Pipelines Table', () => {
createComponent({ pipelines: [pipeline] });
});
it('should pass the pipeline path prop for the counter badge', () => {
expect(findDownstream().props('pipelinePath')).toBe(pipeline.path);
});
it('should render only a downstream pipeline', () => {
expect(findDownstream().exists()).toBe(true);
expect(findUpstream().exists()).toBe(false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment