Commit 2099e33b authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Fix minor review comments

parent 35b7fd7c
...@@ -317,7 +317,7 @@ export default { ...@@ -317,7 +317,7 @@ export default {
<gl-loading-icon v-else-if="!isLoading" size="md" class="my-4 py-4" /> <gl-loading-icon v-else-if="!isLoading" size="md" class="my-4 py-4" />
</template> </template>
<template v-if="featureFlags.hasTasksByTypeChart"> <template v-if="featureFlags.hasTasksByTypeChart">
<div class="tasks-by-type-chart"> <div class="js-tasks-by-type-chart">
<div v-if="shouldDisplayTasksByTypeChart"> <div v-if="shouldDisplayTasksByTypeChart">
<tasks-by-type-chart <tasks-by-type-chart
:chart-data="tasksByTypeChartData" :chart-data="tasksByTypeChartData"
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
}, },
computed: { computed: {
hasData() { hasData() {
return this.chartData && this.chartData.data && this.chartData.data.length; return Boolean(this.chartData?.data?.length);
}, },
selectedFiltersText() { selectedFiltersText() {
const { subject, selectedLabelIds } = this.filters; const { subject, selectedLabelIds } = this.filters;
......
...@@ -274,7 +274,7 @@ describe 'Group Cycle Analytics', :js do ...@@ -274,7 +274,7 @@ describe 'Group Cycle Analytics', :js do
end end
it 'will not display the tasks by type chart' do it 'will not display the tasks by type chart' do
expect(page).not_to have_selector('.tasks-by-type-chart') expect(page).not_to have_selector('.js-tasks-by-type-chart')
expect(page).not_to have_text('Tasks by type') expect(page).not_to have_text('Tasks by type')
end end
......
...@@ -366,7 +366,7 @@ describe('Cycle Analytics component', () => { ...@@ -366,7 +366,7 @@ describe('Cycle Analytics component', () => {
mock.restore(); mock.restore();
}); });
it('displays the tasks by type chart', () => { it('displays the tasks by type chart', () => {
expect(wrapper.find('.tasks-by-type-chart').exists()).toBe(true); expect(wrapper.find('.js-tasks-by-type-chart').exists()).toBe(true);
}); });
}); });
...@@ -390,7 +390,7 @@ describe('Cycle Analytics component', () => { ...@@ -390,7 +390,7 @@ describe('Cycle Analytics component', () => {
}); });
it('does not render the tasks by type chart', () => { it('does not render the tasks by type chart', () => {
expect(wrapper.find('.tasks-by-type-chart').exists()).toBe(false); expect(wrapper.find('.js-tasks-by-type-chart').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