blob: f87e87f4204aacc1a1cbbb3c03def55bf9ab0d32 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* eslint-disable space-before-function-paren, no-return-assign, padded-blocks */
/* global MergeRequest */
require('~/merge_request');
(function() {
describe('MergeRequest', function() {
return describe('task lists', function() {
preloadFixtures('static/merge_requests_show.html.raw');
beforeEach(function() {
loadFixtures('static/merge_requests_show.html.raw');
return this.merge = new MergeRequest();
});
it('modifies the Markdown field', function() {
spyOn(jQuery, 'ajax').and.stub();
$('input[type=checkbox]').attr('checked', true).trigger('change');
return expect($('.js-task-list-field').val()).toBe('- [x] Task List Item');
});
return 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('/foo');
return expect(req.data.merge_request.description).not.toBe(null);
});
return $('.js-task-list-field').trigger('tasklist:changed');
});
});
});
}).call(this);
|