Commit 1a12d008 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents d211e77f 6dbe3e63
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
<add-stage-button <add-stage-button
:class="$options.noDragClass" :class="$options.noDragClass"
:active="isCreatingCustomStage" :active="isCreatingCustomStage"
@showform="$emit('show-add-stage-form')" @showform="$emit($options.STAGE_ACTIONS.ADD_STAGE)"
/> />
</ul> </ul>
</template> </template>
...@@ -56,6 +56,7 @@ export const STAGE_ACTIONS = { ...@@ -56,6 +56,7 @@ export const STAGE_ACTIONS = {
HIDE: 'hideStage', HIDE: 'hideStage',
CREATE: 'createStage', CREATE: 'createStage',
UPDATE: 'updateStage', UPDATE: 'updateStage',
ADD_STAGE: 'showAddStageForm',
}; };
export const STAGE_NAME = { export const STAGE_NAME = {
......
...@@ -113,10 +113,10 @@ module Security ...@@ -113,10 +113,10 @@ module Security
def dismissal_feedback_by_fingerprint def dismissal_feedback_by_fingerprint
strong_memoize(:dismissal_feedback_by_fingerprint) do strong_memoize(:dismissal_feedback_by_fingerprint) do
pipeline.project.vulnerability_feedback pipeline.project
.with_associations .vulnerability_feedback
.where(feedback_type: 'dismissal') # rubocop:disable CodeReuse/ActiveRecord .for_dismissal
.group_by(&:project_fingerprint) .group_by(&:project_fingerprint)
end end
end end
......
...@@ -13,6 +13,7 @@ import StageTable from 'ee/analytics/cycle_analytics/components/stage_table.vue' ...@@ -13,6 +13,7 @@ import StageTable from 'ee/analytics/cycle_analytics/components/stage_table.vue'
import StageTableNav from 'ee/analytics/cycle_analytics/components/stage_table_nav.vue'; import StageTableNav from 'ee/analytics/cycle_analytics/components/stage_table_nav.vue';
import StageNavItem from 'ee/analytics/cycle_analytics/components/stage_nav_item.vue'; import StageNavItem from 'ee/analytics/cycle_analytics/components/stage_nav_item.vue';
import AddStageButton from 'ee/analytics/cycle_analytics/components/add_stage_button.vue'; import AddStageButton from 'ee/analytics/cycle_analytics/components/add_stage_button.vue';
import CustomStageForm from 'ee/analytics/cycle_analytics/components/custom_stage_form.vue';
import FilterBar from 'ee/analytics/cycle_analytics/components/filter_bar.vue'; import FilterBar from 'ee/analytics/cycle_analytics/components/filter_bar.vue';
import DurationChart from 'ee/analytics/cycle_analytics/components/duration_chart.vue'; import DurationChart from 'ee/analytics/cycle_analytics/components/duration_chart.vue';
import Daterange from 'ee/analytics/shared/components/daterange.vue'; import Daterange from 'ee/analytics/shared/components/daterange.vue';
...@@ -137,6 +138,8 @@ describe('Cycle Analytics component', () => { ...@@ -137,6 +138,8 @@ describe('Cycle Analytics component', () => {
.findAll(StageNavItem) .findAll(StageNavItem)
.at(index); .at(index);
const findAddStageButton = () => wrapper.find(AddStageButton);
const displaysProjectsDropdownFilter = flag => { const displaysProjectsDropdownFilter = flag => {
expect(wrapper.find(ProjectsDropdownFilter).exists()).toBe(flag); expect(wrapper.find(ProjectsDropdownFilter).exists()).toBe(flag);
}; };
...@@ -429,6 +432,31 @@ describe('Cycle Analytics component', () => { ...@@ -429,6 +432,31 @@ describe('Cycle Analytics component', () => {
expect(first.props('isActive')).toBe(false); expect(first.props('isActive')).toBe(false);
}); });
}); });
describe('Add stage button', () => {
beforeEach(() => {
wrapper = createComponent({
opts: {
stubs: {
StageTable,
StageTableNav,
AddStageButton,
},
},
withStageSelected: true,
});
});
it('can navigate to the custom stage form', () => {
expect(wrapper.find(CustomStageForm).exists()).toBe(false);
findAddStageButton().trigger('click');
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(CustomStageForm).exists()).toBe(true);
});
});
});
}); });
}); });
......
...@@ -60,9 +60,18 @@ describe('StageTableNav', () => { ...@@ -60,9 +60,18 @@ describe('StageTableNav', () => {
}); });
}); });
it('will render the add a stage button', () => { describe('Add stage button', () => {
wrapper = createComponent(); it('will render', () => {
expect(wrapper.find(AddStageButton).exists()).toBe(true); wrapper = createComponent();
expect(wrapper.find(AddStageButton).exists()).toBe(true);
});
it('will emit showAddStageForm action when clicked', () => {
wrapper = createComponent({ mountFn: mount });
wrapper.find(AddStageButton).trigger('click');
expect(wrapper.emitted('showAddStageForm')).toHaveLength(1);
});
}); });
describe.each` describe.each`
......
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