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
Boxiang Sun
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
Hide 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 @@
...
@@ -2,38 +2,27 @@
//= require environments/components/environment_stop
//= require environments/components/environment_stop
describe('Stop Component', () => {
describe('Stop Component', () => {
fixture.preload('environments/element.html');
fixture.preload('environments/element.html');
let stopURL;
let component;
beforeEach(() => {
beforeEach(() => {
fixture.load('environments/element.html');
fixture.load('environments/element.html');
});
it('should link to the provided URL', () => {
stopURL = '/stop';
const stopURL = '/stop';
component = new window.gl.environmentsList.StopComponent({
const component = new window.gl.environmentsList.StopComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
stop_url: stopURL,
stop_url: stopURL,
},
},
});
});
expect(component.$el.getAttribute('href')).toEqual(stopURL);
});
});
describe('When clicked', () => {
it('should link to the provided URL', () => {
it('Should open popup with confirmation warning', () => {
expect(component.$el.getAttribute('href')).toEqual(stopURL);
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 () {
it('should have a data-confirm attribute', () => {
opened = true;
expect(component.$el.getAttribute('data-confirm')).toEqual('Are you sure you want to stop this environment?');
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