diff --git a/spec/chatbox.js b/spec/chatbox.js index a4c1ec699..86ab22e64 100644 --- a/spec/chatbox.js +++ b/spec/chatbox.js @@ -41,7 +41,7 @@ }).c('body').t('hello world').tree(); await _converse.handleMessageStanza(msg); await u.waitUntil(() => view.content.querySelectorAll('.chat-msg').length); - expect(view.content.lastElementChild.textContent.trim().indexOf('hello world')).not.toBe(-1); + expect(view.msgs_container.lastElementChild.textContent.trim().indexOf('hello world')).not.toBe(-1); done(); })); diff --git a/spec/messages.js b/spec/messages.js index 62f2ec9e4..216bd2df7 100644 --- a/spec/messages.js +++ b/spec/messages.js @@ -788,16 +788,16 @@ expect(msg_obj.get('sender')).toEqual('them'); expect(msg_obj.get('is_delayed')).toEqual(true); await u.waitUntil(() => chatbox.vcard.get('fullname') === 'Juliet Capulet') - expect(view.content.querySelector('.chat-msg .chat-msg__text').textContent).toEqual(message); - expect(view.content.querySelector('.chat-msg__time').textContent.match(/^[0-9][0-9]:[0-9][0-9]/)).toBeTruthy(); - expect(view.content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Juliet Capulet'); + expect(view.msgs_container.querySelector('.chat-msg .chat-msg__text').textContent).toEqual(message); + expect(view.msgs_container.querySelector('.chat-msg__time').textContent.match(/^[0-9][0-9]:[0-9][0-9]/)).toBeTruthy(); + expect(view.msgs_container.querySelector('span.chat-msg__author').textContent.trim()).toBe('Juliet Capulet'); - expect(view.content.querySelectorAll('.date-separator').length).toEqual(1); - let day = view.content.querySelector('.date-separator'); + expect(view.msgs_container.querySelectorAll('.date-separator').length).toEqual(1); + let day = view.msgs_container.querySelector('.date-separator'); expect(day.getAttribute('class')).toEqual('message date-separator'); expect(day.getAttribute('data-isodate')).toEqual(dayjs(one_day_ago.startOf('day')).toISOString()); - let time = view.content.querySelector('time.separator-text'); + let time = view.msgs_container.querySelector('time.separator-text'); expect(time.textContent).toEqual(dayjs(one_day_ago.startOf('day')).format("dddd MMM Do YYYY")); message = 'This is a current message'; @@ -813,15 +813,15 @@ expect(_converse.api.trigger).toHaveBeenCalledWith('message', jasmine.any(Object)); // Check that there is a