Fix failing tests due to time tag

This commit is contained in:
JC Brand 2018-06-30 15:25:25 +02:00
parent 40272351a7
commit 4361d0d66a
2 changed files with 7 additions and 7 deletions

View File

@ -714,8 +714,8 @@
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
var $time = $chat_content.find('time'); let time = chat_content.querySelectorAll('time.separator-text');
expect($time.length).toEqual(4); expect(time.length).toEqual(4);
var $indicator = $chat_content.find('.date-separator:eq(3)'); var $indicator = $chat_content.find('.date-separator:eq(3)');
expect($indicator.attr('class')).toEqual('message date-separator'); expect($indicator.attr('class')).toEqual('message date-separator');
@ -753,8 +753,8 @@
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
$time = $chat_content.find('time'); time = chat_content.querySelectorAll('time.separator-text');
expect($time.length).toEqual(6); expect(time.length).toEqual(6);
$indicator = $chat_content.find('.date-separator:eq(5)'); $indicator = $chat_content.find('.date-separator:eq(5)');
expect($indicator.attr('class')).toEqual('message date-separator'); expect($indicator.attr('class')).toEqual('message date-separator');

View File

@ -577,7 +577,7 @@
expect($el.hasClass('chat-msg-followup')).toBe(false); expect($el.hasClass('chat-msg-followup')).toBe(false);
expect($el.text()).toEqual('Older message'); expect($el.text()).toEqual('Older message');
$time = $chat_content.find('time:eq(1)'); $time = $chat_content.find('time.separator-text:eq(1)');
expect($time.text()).toEqual("Monday Jan 1st 2018"); expect($time.text()).toEqual("Monday Jan 1st 2018");
$day = $chat_content.find('.date-separator:eq(1)'); $day = $chat_content.find('.date-separator:eq(1)');
@ -591,7 +591,7 @@
expect($el.find('.chat-msg-text').text()).toEqual('another inbetween message'); expect($el.find('.chat-msg-text').text()).toEqual('another inbetween message');
expect($el.hasClass('chat-msg-followup')).toBe(true); expect($el.hasClass('chat-msg-followup')).toBe(true);
$time = $chat_content.find('time:nth(2)'); $time = $chat_content.find('time.separator-text:nth(2)');
expect($time.text()).toEqual("Tuesday Jan 2nd 2018"); expect($time.text()).toEqual("Tuesday Jan 2nd 2018");
$day = $chat_content.find('.date-separator:nth(2)'); $day = $chat_content.find('.date-separator:nth(2)');
@ -928,7 +928,7 @@
expect(_converse.emit).toHaveBeenCalledWith('message', jasmine.any(Object)); expect(_converse.emit).toHaveBeenCalledWith('message', jasmine.any(Object));
// Check that there is a <time> element, with the required // Check that there is a <time> element, with the required
// props. // props.
expect($chat_content[0].querySelectorAll('time').length).toEqual(2); // There are now two time elements expect($chat_content[0].querySelectorAll('time.separator-text').length).toEqual(2); // There are now two time elements
var message_date = new Date(); var message_date = new Date();
$day = $chat_content.find('.date-separator:last'); $day = $chat_content.find('.date-separator:last');