Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Feb 11, 2019
1 parent b7d229b commit 6170d8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/rocketchat-ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions tests/end-to-end/ui/07-emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('😀');
});
});
Expand Down Expand Up @@ -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('😄');
});
});
Expand Down

0 comments on commit 6170d8e

Please sign in to comment.