diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index d37c040183e6..b5efc28d9353 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -968,14 +968,18 @@ Template.room.onCreated(function() { this.messages = new ReactiveVar([]); - const updateMessages = _.debounce(() => { + const updateMessages = () => { + this.messages.set(ChatMessage.find(query, options).fetch()); + }; + + const updateMessagesDebounced = _.debounce(() => { this.messages.set(ChatMessage.find(query, options).fetch()); }, 100); this.messageObserver = ChatMessage.find(query).observe({ - added: updateMessages, - updated: updateMessages, - removed: updateMessages, + added: process.env.TEST_MODE ? updateMessages : updateMessagesDebounced, + updated: process.env.TEST_MODE ? updateMessages : updateMessagesDebounced, + removed: process.env.TEST_MODE ? updateMessages : updateMessagesDebounced, }); }); // Update message to re-render DOM diff --git a/tests/end-to-end/ui/07-emoji.js b/tests/end-to-end/ui/07-emoji.js index a6025d34fc6d..2a4ef28bab1e 100644 --- a/tests/end-to-end/ui/07-emoji.js +++ b/tests/end-to-end/ui/07-emoji.js @@ -98,6 +98,7 @@ describe('[Emoji]', () => { }); it('it should be that the value on the message is the same as the emoji clicked', () => { + browser.pause(100); mainContent.lastMessage.getText().should.equal('😀'); }); }); @@ -132,6 +133,7 @@ describe('[Emoji]', () => { }); it('it should be that the value on the message is the same as the emoji clicked', () => { + browser.pause(100); mainContent.lastMessage.getText().should.equal('😄'); }); });