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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b4b534af
Commit
b4b534af
authored
Feb 21, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds tests to unsuccessful response
parent
0d22ab42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
spec/javascripts/environments/deploy_board_component_spec.js.es6
...vascripts/environments/deploy_board_component_spec.js.es6
+38
-0
spec/javascripts/environments/environment_table_spec.js.es6
spec/javascripts/environments/environment_table_spec.js.es6
+4
-0
No files found.
spec/javascripts/environments/deploy_board_component_spec.js.es6
View file @
b4b534af
...
...
@@ -76,4 +76,42 @@ describe('Deploy Board', () => {
}, 0);
});
});
describe('unsuccessfull request', () => {
const deployBoardErrorInterceptor = (request, next) => {
next(request.respondWith(JSON.stringify({}), {
status: 500,
}));
};
let component;
beforeEach(() => {
Vue.http.interceptors.push(deployBoardErrorInterceptor);
this.service = new Service('environments');
component = new DeployBoardComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
store: {},
service: this.service,
deployBoardData: {},
environmentID: 1,
},
});
});
afterEach(() => {
Vue.http.interceptors = _.without(Vue.http.interceptors, deployBoardErrorInterceptor);
});
it('should render empty state', (done) => {
setTimeout(() => {
expect(component.$el.children.length,).toEqual(0);
done();
}, 0);
});
});
});
spec/javascripts/environments/environment_table_spec.js.es6
View file @
b4b534af
...
...
@@ -36,6 +36,8 @@ describe('Environment item', () => {
size: 1,
environment_path: 'url',
id: 1,
rollout_status: 'url',
hasDeployBoard: true,
deployBoardData: {
instances: [
{ status: 'ready', tooltip: 'foo' },
...
...
@@ -72,6 +74,8 @@ describe('Environment item', () => {
size: 1,
environment_path: 'url',
id: 1,
rollout_status: 'url',
hasDeployBoard: true,
deployBoardData: {
instances: [
{ status: 'ready', tooltip: 'foo' },
...
...
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