Fix linting errors
This commit is contained in:
parent
db550b3ec7
commit
bda567ca01
@ -41,8 +41,8 @@
|
||||
const textarea = view.el.querySelector('textarea.chat-textarea');
|
||||
const at_event = {
|
||||
'target': textarea,
|
||||
'preventDefault': function noop () {},
|
||||
'stopPropagation': function noop () {},
|
||||
'preventDefault': function preventDefault () {},
|
||||
'stopPropagation': function stopPropagation () {},
|
||||
'keyCode': 50,
|
||||
'key': '@'
|
||||
};
|
||||
@ -84,8 +84,8 @@
|
||||
// Press tab
|
||||
const tab_event = {
|
||||
'target': textarea,
|
||||
'preventDefault': function noop () {},
|
||||
'stopPropagation': function noop () {},
|
||||
'preventDefault': function preventDefault () {},
|
||||
'stopPropagation': function stopPropagation () {},
|
||||
'keyCode': 9,
|
||||
'key': 'Tab'
|
||||
}
|
||||
@ -97,7 +97,7 @@
|
||||
|
||||
const backspace_event = {
|
||||
'target': textarea,
|
||||
'preventDefault': function noop () {},
|
||||
'preventDefault': function preventDefault () {},
|
||||
'keyCode': 8
|
||||
}
|
||||
for (var i=0; i<3; i++) {
|
||||
@ -129,7 +129,7 @@
|
||||
const up_arrow_event = {
|
||||
'target': textarea,
|
||||
'preventDefault': () => (up_arrow_event.defaultPrevented = true),
|
||||
'stopPropagation': function noop () {},
|
||||
'stopPropagation': function stopPropagation () {},
|
||||
'keyCode': 38
|
||||
}
|
||||
view.onKeyDown(up_arrow_event);
|
||||
@ -140,8 +140,8 @@
|
||||
|
||||
view.onKeyDown({
|
||||
'target': textarea,
|
||||
'preventDefault': function noop () {},
|
||||
'stopPropagation': function noop () {},
|
||||
'preventDefault': function preventDefault () {},
|
||||
'stopPropagation': function stopPropagation () {},
|
||||
'keyCode': 13 // Enter
|
||||
});
|
||||
expect(textarea.value).toBe('hello s @some2 ');
|
||||
@ -195,8 +195,8 @@
|
||||
// Press backspace
|
||||
const backspace_event = {
|
||||
'target': textarea,
|
||||
'preventDefault': function noop () {},
|
||||
'stopPropagation': function noop () {},
|
||||
'preventDefault': function preventDefault () {},
|
||||
'stopPropagation': function stopPropagation () {},
|
||||
'keyCode': 8,
|
||||
'key': 'Backspace'
|
||||
}
|
||||
|
@ -497,7 +497,7 @@
|
||||
const textarea = view.el.querySelector('.chat-textarea');
|
||||
const ev = {
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
};
|
||||
view.onKeyDown(ev);
|
||||
@ -1167,7 +1167,7 @@
|
||||
view.el.querySelector('.chat-textarea').value = message;
|
||||
view.onKeyDown({
|
||||
target: view.el.querySelector('textarea.chat-textarea'),
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(view.clearMessages).toHaveBeenCalled();
|
||||
|
@ -267,7 +267,7 @@
|
||||
async function (done, _converse) {
|
||||
|
||||
const xhr = {
|
||||
'open': function noop () {},
|
||||
'open': function open () {},
|
||||
'send': function () {
|
||||
xhr.responseText = JSON.stringify([
|
||||
{"jid": "marty@mcfly.net", "fullname": "Marty McFly"},
|
||||
@ -328,7 +328,7 @@
|
||||
test_utils.createContacts(_converse, 'all').openControlBox();
|
||||
var modal;
|
||||
const xhr = {
|
||||
'open': function noop () {},
|
||||
'open': function open () {},
|
||||
'send': function () {
|
||||
const value = modal.el.querySelector('input[name="name"]').value;
|
||||
if (value === 'existing') {
|
||||
|
@ -27,7 +27,7 @@
|
||||
textarea.value = 'But soft, what light through yonder airlock breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -55,7 +55,7 @@
|
||||
textarea.value = 'But soft, what light through yonder window breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
expect(_converse.connection.send).toHaveBeenCalled();
|
||||
@ -161,7 +161,7 @@
|
||||
textarea.value = 'But soft, what light through yonder airlock breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -184,7 +184,7 @@
|
||||
textarea.value = 'But soft, what light through yonder window breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
expect(_converse.connection.send).toHaveBeenCalled();
|
||||
@ -237,7 +237,7 @@
|
||||
textarea.value = 'It is the east, and Juliet is the one.';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -246,7 +246,7 @@
|
||||
textarea.value = 'Arise, fair sun, and kill the envious moon';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -277,7 +277,7 @@
|
||||
textarea.value = 'It is the east, and Juliet is the sun.';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.model.messages.once('rendered', resolve));
|
||||
@ -1331,7 +1331,7 @@
|
||||
textarea.value = 'But soft, what light through yonder airlock breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await u.waitUntil(() => _converse.api.chats.get().length);
|
||||
@ -1354,7 +1354,7 @@
|
||||
textarea.value = 'Another message';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -2537,7 +2537,7 @@
|
||||
textarea.value = 'But soft, what light through yonder airlock breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -2561,7 +2561,7 @@
|
||||
textarea.value = 'But soft, what light through yonder window breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
expect(_converse.connection.send).toHaveBeenCalled();
|
||||
@ -2636,7 +2636,7 @@
|
||||
textarea.value = 'But soft, what light through yonder airlock breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -2715,7 +2715,7 @@
|
||||
textarea.value = 'But soft, what light through yonder airlock breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -2751,7 +2751,7 @@
|
||||
textarea.value = 'But soft, what light through yonder airlock breaks?';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -2996,8 +2996,8 @@
|
||||
textarea.value = 'hello @z3r0 @gibson @mr.robot, how are you?'
|
||||
const enter_event = {
|
||||
'target': textarea,
|
||||
'preventDefault': function noop () {},
|
||||
'stopPropagation': function noop () {},
|
||||
'preventDefault': function preventDefault () {},
|
||||
'stopPropagation': function stopPropagation () {},
|
||||
'keyCode': 13 // Enter
|
||||
}
|
||||
spyOn(_converse.connection, 'send');
|
||||
@ -3074,8 +3074,8 @@
|
||||
textarea.value = 'hello @z3r0 @gibson @mr.robot, how are you?'
|
||||
const enter_event = {
|
||||
'target': textarea,
|
||||
'preventDefault': function noop () {},
|
||||
'stopPropagation': function noop () {},
|
||||
'preventDefault': function preventDefault () {},
|
||||
'stopPropagation': function stopPropagation () {},
|
||||
'keyCode': 13 // Enter
|
||||
}
|
||||
view.onKeyDown(enter_event);
|
||||
|
28
spec/muc.js
28
spec/muc.js
@ -2011,7 +2011,7 @@
|
||||
textarea.value = text;
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -2864,7 +2864,7 @@
|
||||
const textarea = view.el.querySelector('.chat-textarea');
|
||||
textarea.value = '/clear';
|
||||
|
||||
const enter = { 'target': textarea, 'preventDefault': function noop () {}, 'keyCode': 13 };
|
||||
const enter = { 'target': textarea, 'preventDefault': function preventDefault () {}, 'keyCode': 13 };
|
||||
view.onKeyDown(enter);
|
||||
textarea.value = '/help';
|
||||
view.onKeyDown(enter);
|
||||
@ -2935,7 +2935,7 @@
|
||||
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo');
|
||||
const view = _converse.chatboxviews.get('lounge@montague.lit');
|
||||
var textarea = view.el.querySelector('.chat-textarea');
|
||||
const enter = { 'target': textarea, 'preventDefault': function noop () {}, 'keyCode': 13 };
|
||||
const enter = { 'target': textarea, 'preventDefault': function preventDefault () {}, 'keyCode': 13 };
|
||||
spyOn(window, 'confirm').and.callFake(() => true);
|
||||
textarea.value = '/clear';
|
||||
view.onKeyDown(enter);
|
||||
@ -2999,7 +2999,7 @@
|
||||
textarea.value = '/member chris Welcome to the club!';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(_converse.connection.send).not.toHaveBeenCalled();
|
||||
@ -3011,7 +3011,7 @@
|
||||
textarea.value = '/member marc Welcome to the club!';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(_converse.connection.send).toHaveBeenCalled();
|
||||
@ -3126,7 +3126,7 @@
|
||||
textarea.value = '/topic This is the groupchat subject';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(_converse.connection.send).toHaveBeenCalled();
|
||||
@ -3136,7 +3136,7 @@
|
||||
textarea.value = '/subject This is a new subject';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
|
||||
@ -3150,7 +3150,7 @@
|
||||
textarea.value = '/Subject This is yet another subject';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(sent_stanza.textContent).toBe('This is yet another subject');
|
||||
@ -3173,7 +3173,7 @@
|
||||
textarea.value = '/clear';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(view.clearMessages).toHaveBeenCalled();
|
||||
@ -3215,7 +3215,7 @@
|
||||
textarea.value = '/owner';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled();
|
||||
@ -3303,7 +3303,7 @@
|
||||
textarea.value = '/ban';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled();
|
||||
@ -3404,7 +3404,7 @@
|
||||
textarea.value = '/kick';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled();
|
||||
@ -3508,7 +3508,7 @@
|
||||
textarea.value = '/op';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
|
||||
@ -3651,7 +3651,7 @@
|
||||
textarea.value = '/mute';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
|
||||
|
@ -126,7 +126,7 @@
|
||||
textarea.value = 'This message will be encrypted';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
iq_stanza = await u.waitUntil(() => bundleFetched(_converse, contact_jid, '555'));
|
||||
@ -310,7 +310,7 @@
|
||||
textarea.value = 'This message will be encrypted';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
iq_stanza = await u.waitUntil(() => bundleFetched(_converse, contact_jid, '4e30f35051b7b8b42abe083742187228'), 1000);
|
||||
@ -458,7 +458,7 @@
|
||||
textarea.value = 'This is an encrypted message from this device';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
iq_stanza = await u.waitUntil(() => bundleFetched(_converse, _converse.bare_jid, '988349631'));
|
||||
@ -515,7 +515,7 @@
|
||||
textarea.value = 'This message will be encrypted';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13 // Enter
|
||||
});
|
||||
let iq_stanza = await u.waitUntil(() => deviceListFetched(_converse, contact_jid));
|
||||
@ -1251,7 +1251,7 @@
|
||||
textarea.value = 'This message will be sent encrypted';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
textarea.value = '/register';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
let stanza = await u.waitUntil(() => _.filter(
|
||||
|
@ -111,7 +111,7 @@
|
||||
textarea.value = 'This is the spoiler';
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
@ -188,7 +188,7 @@
|
||||
|
||||
view.onKeyDown({
|
||||
target: textarea,
|
||||
preventDefault: function noop () {},
|
||||
preventDefault: function preventDefault () {},
|
||||
keyCode: 13
|
||||
});
|
||||
await new Promise((resolve, reject) => view.once('messageInserted', resolve));
|
||||
|
@ -112,8 +112,8 @@ converse.plugins.add('converse-headline', {
|
||||
},
|
||||
|
||||
// Override to avoid the methods in converse-chatview.js
|
||||
'renderMessageForm': function noop () {},
|
||||
'afterShown': function noop () {}
|
||||
'renderMessageForm': function renderMessageForm () {},
|
||||
'afterShown': function afterShown () {}
|
||||
});
|
||||
|
||||
async function onHeadlineMessage (message) {
|
||||
|
@ -78,7 +78,7 @@ converse.plugins.add("converse-oauth", {
|
||||
});
|
||||
|
||||
_converse.OAuthProviders = _converse.Collection.extend({
|
||||
'sync': _function noop () {},
|
||||
'sync': function sync () {},
|
||||
|
||||
initialize () {
|
||||
_.each(_converse.user_settings.oauth_providers, (provider) => {
|
||||
|
Loading…
Reference in New Issue
Block a user