Commit 3223dd26 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'env-dashboard-fixes-fe' into 'master'

Add Action to Remove Project from Env Dashboard

See merge request gitlab-org/gitlab-ee!14563
parents 25744f79 a71467b5
......@@ -94,6 +94,7 @@ export default {
'clearSearchResults',
'toggleSelectedProject',
'setSearchQuery',
'removeProject',
]),
addProjects() {
this.addProjectsToDashboard();
......@@ -153,7 +154,7 @@ export default {
<div class="prepend-top-default">
<div v-if="projects.length" class="dashboard-cards">
<div v-for="project in projects" :key="project.id" class="column prepend-top-default">
<project-header :project="project" />
<project-header :project="project" @remove="removeProject" />
<div class="row">
<environment
v-for="environment in project.environments"
......
---
title: Add Ability to Remove Projects From the Envivonment Dashboard
merge_request: 14563
author:
type: feature
......@@ -26,6 +26,7 @@ describe('dashboard', () => {
clearSearchResults: jest.fn(),
setSearchQuery: jest.fn(),
fetchSearchResults: jest.fn(),
removeProject: jest.fn(),
toggleSelectedProject: jest.fn(),
};
propsData = {
......@@ -89,6 +90,12 @@ describe('dashboard', () => {
const headers = wrapper.findAll(ProjectHeader);
expect(headers.length).toBe(2);
});
it('should remove a project if it emits `remove`', () => {
const header = wrapper.find(ProjectHeader);
header.vm.$emit('remove');
expect(actionSpies.removeProject).toHaveBeenCalled();
});
});
describe('environment component', () => {
......
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