Commit 7b86e24b authored by JC Brand's avatar JC Brand

Add missing CSS class to bookmark list item and fix test

updates #1069
parent 388719ff
......@@ -83944,7 +83944,7 @@ __p += ' hidden ';
} ;
__p += '" data-room-jid="' +
__e(o.jid) +
'">\n <a class="open-room w-100" data-room-jid="' +
'">\n <a class="list-item-link open-room w-100" data-room-jid="' +
__e(o.jid) +
'" title="' +
__e(o.open_title) +
......@@ -516,20 +516,28 @@
_converse.connection._dataRecv(test_utils.createRequest(stanza));
test_utils.waitUntil(function () {
return $('#chatrooms div.bookmarks.rooms-list .room-item').length;
return document.querySelectorAll('#chatrooms div.bookmarks.rooms-list .room-item').length;
}, 300).then(function () {
expect($('#chatrooms div.bookmarks.rooms-list .room-item').length).toBe(4);
expect($('#chatrooms div.bookmarks.rooms-list .room-item a').text().trim()).toBe(
"1st Bookmark  Another room  Bookmark with a very very long name that will be shortened  The Play's the Thing")
expect(document.querySelectorAll('#chatrooms div.bookmarks.rooms-list .room-item').length).toBe(4);
const els = document.querySelectorAll('#chatrooms div.bookmarks.rooms-list .room-item a.list-item-link');
expect(els[0].textContent).toBe("1st Bookmark");
expect(els[1].textContent).toBe("Another room");
expect(els[2].textContent).toBe("Bookmark with a very very long name that will be shortened");
expect(els[3].textContent).toBe("The Play's the Thing");
spyOn(window, 'confirm').and.returnValue(true);
$('#chatrooms .bookmarks.rooms-list .room-item:nth-child(2) a:nth-child(2)')[0].click();
document.querySelector('#chatrooms .bookmarks.rooms-list .room-item:nth-child(2) a:nth-child(2)').click();
expect(window.confirm).toHaveBeenCalled();
return test_utils.waitUntil(function () {
return $('#chatrooms .bookmarks.rooms-list .room-item a').text().trim() ===
"1st Bookmark  Bookmark with a very very long name that will be shortened  The Play's the Thing";
return document.querySelectorAll('#chatrooms div.bookmarks.rooms-list .room-item').length === 3;
}, 300)
}).then(done);
}).then(() => {
const els = document.querySelectorAll('#chatrooms div.bookmarks.rooms-list .room-item a.list-item-link');
expect(els[0].textContent).toBe("1st Bookmark");
expect(els[1].textContent).toBe("Bookmark with a very very long name that will be shortened");
expect(els[2].textContent).toBe("The Play's the Thing");
done();
}).catch(_.partial(console.error, _));
});
}));
......
<div class="list-item controlbox-padded room-item available-chatroom d-flex flex-row {[ if (o.hidden) { ]} hidden {[ } ]}" data-room-jid="{{{o.jid}}}">
<a class="open-room w-100" data-room-jid="{{{o.jid}}}" title="{{{o.open_title}}}" href="#">{{{o.name}}}</a>
<a class="list-item-link open-room w-100" data-room-jid="{{{o.jid}}}" title="{{{o.open_title}}}" href="#">{{{o.name}}}</a>
<a class="list-item-action remove-bookmark fa fa-bookmark align-self-center {[ if (o.bookmarked) { ]} button-on {[ } ]}"
data-room-jid="{{{o.jid}}}" data-bookmark-name="{{{o.name}}}"
title="{{{o.info_remove_bookmark}}}" href="#">&nbsp;</a>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment