Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
531d4e56
Commit
531d4e56
authored
Nov 19, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test
parent
6e5a1ea0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
22 deletions
+11
-22
spec/javascripts/environments/environment_stop_spec.js.es6
spec/javascripts/environments/environment_stop_spec.js.es6
+11
-22
No files found.
spec/javascripts/environments/environment_stop_spec.js.es6
View file @
531d4e56
...
...
@@ -2,38 +2,27 @@
//= require environments/components/environment_stop
describe('Stop Component', () => {
fixture.preload('environments/element.html');
let stopURL;
let component;
beforeEach(() => {
fixture.load('environments/element.html');
});
it('should link to the provided URL', () => {
const stopURL = '/stop';
const component = new window.gl.environmentsList.StopComponent({
stopURL = '/stop';
component = new window.gl.environmentsList.StopComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
stop_url: stopURL,
},
});
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: '#',
},
it('should link to the provided URL', () => {
expect(component.$el.getAttribute('href')).toEqual(stopURL);
});
let opened = false;
spyOn(window, 'confirm').and.callFake(function () {
opened = true;
expect(opened).toEqual(true);
return false;
});
component.$el.click();
});
it('should have a data-confirm attribute', () => {
expect(component.$el.getAttribute('data-confirm')).toEqual('Are you sure you want to stop this environment?');
});
});
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