Skip to content

Commit

Permalink
Use the API in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbrand committed Feb 22, 2019
1 parent bfaa7e4 commit 04f88d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@

await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length);
await test_utils.openChatBoxFor(_converse, contact_jid);
const chatview = await _converse.api.chatviews.get(contact_jid);
const chatview = _converse.api.chatviews.get(contact_jid);
expect(u.isVisible(chatview.el)).toBeTruthy();
expect(chatview.model.get('minimized')).toBeFalsy();
chatview.el.querySelector('.toggle-chatbox-button').click();
Expand Down Expand Up @@ -2003,7 +2003,7 @@
_converse.emit('rosterContactsFetched');
const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost';
await test_utils.openChatBoxFor(_converse, contact_jid)
const view = await _converse.api.chatviews.get(contact_jid);
const view = _converse.api.chatviews.get(contact_jid);
spyOn(view.model, 'sendMessage').and.callThrough();
const url = base_url+"/logo/conversejs-filled.svg";

Expand Down Expand Up @@ -2160,7 +2160,7 @@
async function (done, _converse) {

await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy');
const view = _converse.chatboxviews.get('lounge@localhost');
const view = _converse.api.chatviews.get('lounge@localhost');
if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); }
const message = 'dummy: Your attention is required';
const nick = mock.chatroom_names[0],
Expand Down Expand Up @@ -2259,7 +2259,7 @@

test_utils.createContacts(_converse, 'current');
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy');
const view = _converse.chatboxviews.get('lounge@localhost');
const view = _converse.api.chatviews.get('lounge@localhost');
const msg = $msg({
from: 'lounge@localhost/dummy',
id: (new Date()).getTime(),
Expand All @@ -2279,7 +2279,7 @@
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy');
const jid = 'lounge@localhost';
const room = _converse.api.rooms.get(jid);
const view = _converse.chatboxviews.get(jid);
const view = _converse.api.chatviews.get(jid);
const stanza = $pres({
to: 'dummy@localhost/_converse.js-29092160',
from: '[email protected]/newguy'
Expand Down Expand Up @@ -2345,7 +2345,7 @@
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy');
const room_jid = 'lounge@localhost';
const room = _converse.api.rooms.get(room_jid);
const view = _converse.chatboxviews.get(room_jid);
const view = _converse.api.chatviews.get(room_jid);
const textarea = view.el.querySelector('textarea.chat-textarea');
expect(textarea.value).toBe('');
view.keyPressed({
Expand Down

0 comments on commit 04f88d1

Please sign in to comment.