BigW Consortium Gitlab

Commit 2084555a by Simon Knox

update karma test to expect ajax instead of POST

parent 4e4639b5
......@@ -35,15 +35,13 @@ require('~/lib/utils/text_utility');
expect($('.js-task-list-field').val()).toBe('- [x] Task List Item');
});
it('submits the form on tasklist:changed', function() {
var submitted = false;
$('form').on('submit', function(e) {
submitted = true;
e.preventDefault();
it('submits an ajax request on tasklist:changed', function() {
spyOn(jQuery, 'ajax').and.callFake(function(req) {
expect(req.type).toBe('PATCH');
expect(req.url).toBe('http://test.host/frontend-fixtures/issues-project/notes/1');
return expect(req.data.note).not.toBe(null);
});
$('.js-task-list-field').trigger('tasklist:changed');
expect(submitted).toBe(true);
return $('.js-task-list-field').trigger('tasklist:changed');
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment