Commit f3339572 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch '338777-fix-linked-pipelines-counter' into 'master'

Fix linked pipelines downstream counter badge link [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!68962
parents 79fa50e2 9b029853
......@@ -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