8cce70730c
* new merge request can be created by sending an email to the specific email address (similar to creating issues by email) * for the first iteration, source branch must be specified in the mail subject, other merge request parameters can not be set yet * user should enable "Receive notifications about your own activity" in user settings to receive a notification about created merge request Part of #32878
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
import IssuableIndex from '~/issuable_index';
|
|
|
|
describe('Issuable', () => {
|
|
let Issuable;
|
|
describe('initBulkUpdate', () => {
|
|
it('should not set bulkUpdateSidebar', () => {
|
|
Issuable = new IssuableIndex('issue_');
|
|
expect(Issuable.bulkUpdateSidebar).not.toBeDefined();
|
|
});
|
|
|
|
it('should set bulkUpdateSidebar', () => {
|
|
const element = document.createElement('div');
|
|
element.classList.add('issues-bulk-update');
|
|
document.body.appendChild(element);
|
|
|
|
Issuable = new IssuableIndex('issue_');
|
|
expect(Issuable.bulkUpdateSidebar).toBeDefined();
|
|
});
|
|
});
|
|
|
|
describe('resetIncomingEmailToken', () => {
|
|
beforeEach(() => {
|
|
const element = document.createElement('a');
|
|
element.classList.add('incoming-email-token-reset');
|
|
element.setAttribute('href', 'foo');
|
|
document.body.appendChild(element);
|
|
|
|
const input = document.createElement('input');
|
|
input.setAttribute('id', 'issuable_email');
|
|
document.body.appendChild(input);
|
|
|
|
Issuable = new IssuableIndex('issue_');
|
|
});
|
|
|
|
it('should send request to reset email token', () => {
|
|
spyOn(jQuery, 'ajax').and.callThrough();
|
|
document.querySelector('.incoming-email-token-reset').click();
|
|
|
|
expect(jQuery.ajax).toHaveBeenCalled();
|
|
expect(jQuery.ajax.calls.argsFor(0)[0].url).toEqual('foo');
|
|
});
|
|
});
|
|
});
|
|
|