Commit 5df7a5d0 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'fix-mr-analytics-data-table' into 'master'

Conditionally render MR Analytics throughput table milestone column data

See merge request gitlab-org/gitlab!39575
parents 113a6c0e 72d86be5
......@@ -220,7 +220,9 @@ export default {
</template>
<template #cell(milestone)="{ item }">
<div :data-testid="$options.testIds.MILESTONE">{{ item.milestone.title }}</div>
<div v-if="item.milestone" :data-testid="$options.testIds.MILESTONE">
{{ item.milestone.title }}
</div>
</template>
<template #cell(pipelines)="{ item }">
......
......@@ -199,8 +199,20 @@ describe('ThroughputTable', () => {
expect(findCol(TEST_IDS.TIME_TO_MERGE).text()).toBe('4 minutes');
});
it('displays the correct milestone', () => {
expect(findCol(TEST_IDS.MILESTONE).text()).toBe('v1.0');
it('does not display a milestone if not present', () => {
expect(findCol(TEST_IDS.MILESTONE).exists()).toBe(false);
});
it('displays the correct milestone when available', async () => {
const title = 'v1.0';
additionalData({
milestone: { title },
});
await wrapper.vm.$nextTick();
expect(findCol(TEST_IDS.MILESTONE).text()).toBe(title);
});
it('displays the correct pipeline count', () => {
......
......@@ -63,7 +63,7 @@ export const throughputTableData = [
createdAt: '2020-08-06T16:53:50Z',
mergedAt: '2020-08-06T16:57:53Z',
webUrl: 'http://127.0.0.1:3001/gitlab-org/gitlab-shell/-/merge_requests/11',
milestone: { title: 'v1.0' },
milestone: null,
assignees: {
nodes: [
{
......
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