split up ll tests in several functions

This commit is contained in:
Bruno Windels 2018-09-13 12:02:49 +02:00
parent 1725e7524b
commit 5d06c65ce5

View file

@ -29,10 +29,16 @@ const {enableLazyLoading} = require('../usecases/settings');
module.exports = async function lazyLoadingScenarios(alice, bob, charlies) { module.exports = async function lazyLoadingScenarios(alice, bob, charlies) {
console.log(" creating a room for lazy loading member scenarios:"); console.log(" creating a room for lazy loading member scenarios:");
await enableLazyLoading(alice); await enableLazyLoading(alice);
const room = "Lazy Loading Test"; await setupRoomWithBobAliceAndCharlies(alice, bob, charlies);
const alias = "#lltest:localhost"; await checkPaginatedDisplayNames(alice, charlies);
const charlyMsg1 = "hi bob!"; }
const charlyMsg2 = "how's it going??";
const room = "Lazy Loading Test";
const alias = "#lltest:localhost";
const charlyMsg1 = "hi bob!";
const charlyMsg2 = "how's it going??";
async function setupRoomWithBobAliceAndCharlies(alice, bob, charlies) {
await createRoom(bob, room); await createRoom(bob, room);
await changeRoomSettings(bob, {directory: true, visibility: "public_no_guests", alias}); await changeRoomSettings(bob, {directory: true, visibility: "public_no_guests", alias});
// wait for alias to be set by server after clicking "save" // wait for alias to be set by server after clicking "save"
@ -47,6 +53,9 @@ module.exports = async function lazyLoadingScenarios(alice, bob, charlies) {
} }
bob.log.unmute().done(); bob.log.unmute().done();
await join(alice, alias); await join(alice, alias);
}
async function checkPaginatedDisplayNames(alice, charlies) {
await scrollToTimelineTop(alice); await scrollToTimelineTop(alice);
//alice should see 2 messages from every charly with //alice should see 2 messages from every charly with
//the correct display name //the correct display name