BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6e5a1ea0
Commit
6e5a1ea0
authored
Nov 19, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken test
parent
f9a662c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
environment_stop.js.es6
...vascripts/environments/components/environment_stop.js.es6
+2
-7
environment_stop_spec.js.es6
spec/javascripts/environments/environment_stop_spec.js.es6
+20
-0
No files found.
app/assets/javascripts/environments/components/environment_stop.js.es6
View file @
6e5a1ea0
...
...
@@ -13,16 +13,11 @@
},
},
methods: {
openConfirmDialog() {
return window.confirm('Are you sure you want to stop this environment?'); // eslint-disable-line
},
},
template: `
<a
v-on:click="openConfirmDialog"
<a
class="btn stop-env-link"
:href="stop_url"
data-confirm="Are you sure you want to stop this environment?"
data-method="post"
rel="nofollow">
<i class="fa fa-stop stop-env-icon"></i>
...
...
spec/javascripts/environments/environment_stop_spec.js.es6
View file @
6e5a1ea0
...
...
@@ -16,4 +16,24 @@ describe('Stop Component', () => {
});
expect(component.$el.getAttribute('href')).toEqual(stopURL);
});
describe('When clicked', () => {
it('Should open popup with confirmation warning', () => {
const component = new window.gl.environmentsList.StopComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
stop_url: '#',
},
});
let opened = false;
spyOn(window, 'confirm').and.callFake(function () {
opened = true;
expect(opened).toEqual(true);
return false;
});
component.$el.click();
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment