Skip to content
Snippets Groups Projects
Unverified Commit 39fa8355 authored by Phil Hughes's avatar Phil Hughes
Browse files

fixed unhandled promise rejection

parent 10cc5d1a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -75,12 +75,12 @@ Sidebar.prototype.toggleTodo = function(e) {
 
$('.js-issuable-todo').disable().addClass('is-loading');
 
return axios[ajaxType](url, {
axios[ajaxType](url, {
issuable_id: $this.data('issuable-id'),
issuable_type: $this.data('issuable-type'),
}).then(({ data }) => {
this.todoUpdateDone(data);
});
}).catch(() => flash(`There was an error ${ajaxType === 'post' ? 'adding a' : 'deleting the'} todo.`));
};
 
Sidebar.prototype.todoUpdateDone = function(data) {
Loading
Loading
Loading
Loading
@@ -74,8 +74,7 @@ import Sidebar from '~/right_sidebar';
 
it('should broadcast todo:toggle event when add todo clicked', function(done) {
var todos = getJSONFixture('todos/todos.json');
spyOn(axios, 'get').and.callThrough();
mock.onAny(`${gl.TEST_HOST}/frontend-fixtures/issues-project/todos`).reply(200, todos);
mock.onPost(/(.*)\/todos$/).reply(200, todos);
 
var todoToggleSpy = spyOnEvent(document, 'todo:toggle');
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment