Commit f84c443b authored by JC Brand's avatar JC Brand

Remove jQuery from converse-muc.js

parent 0eee4458
...@@ -2417,6 +2417,13 @@ ...@@ -2417,6 +2417,13 @@
expect(view.renderPasswordForm).toHaveBeenCalled(); expect(view.renderPasswordForm).toHaveBeenCalled();
expect($chat_body.find('form.chatroom-form').length).toBe(1); expect($chat_body.find('form.chatroom-form').length).toBe(1);
expect($chat_body.find('legend').text()).toBe('This chatroom requires a password'); expect($chat_body.find('legend').text()).toBe('This chatroom requires a password');
// Let's submit the form
spyOn(view, 'join');
var input_el = view.el.querySelector('[name="password"]');
input_el.value = 'secret';
view.el.querySelector('input[type=submit]').click();
expect(view.join).toHaveBeenCalledWith(undefined, "secret");
done(); done();
})); }));
...@@ -2480,6 +2487,10 @@ ...@@ -2480,6 +2487,10 @@
spyOn(view, 'showErrorMessage').and.callThrough(); spyOn(view, 'showErrorMessage').and.callThrough();
view.onChatRoomPresence(presence); view.onChatRoomPresence(presence);
expect(view.$el.find('.chatroom-body form.chatroom-form label:first').text()).toBe('Please choose your nickname'); expect(view.$el.find('.chatroom-body form.chatroom-form label:first').text()).toBe('Please choose your nickname');
var $input = view.$el.find('.chatroom-body form.chatroom-form input:first');
$input.val('nicky');
view.el.querySelector('input[type=submit]').click();
done(); done();
})); }));
......
This diff is collapsed.
...@@ -241,11 +241,11 @@ ...@@ -241,11 +241,11 @@
logger.warn(err); logger.warn(err);
return reject(new Error(err)); return reject(new Error(err));
} else if (_.includes(el.classList, 'collapsed')) { } else if (_.includes(el.classList, 'collapsed')) {
return resolve(); return resolve(el);
} else if (window.converse_disable_effects) { // Effects are disabled (for tests) } else if (window.converse_disable_effects) { // Effects are disabled (for tests)
el.classList.add('collapsed'); el.classList.add('collapsed');
el.style.height = ""; el.style.height = "";
return resolve(); return resolve(el);
} }
const marker = el.getAttribute('data-slider-marker'); const marker = el.getAttribute('data-slider-marker');
if (marker) { if (marker) {
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
el.removeAttribute('data-slider-marker'); el.removeAttribute('data-slider-marker');
el.classList.add('collapsed'); el.classList.add('collapsed');
el.style.height = ""; el.style.height = "";
resolve(); resolve(el);
} }
} }
el.setAttribute( el.setAttribute(
......
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