Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try and make the seamless pagination test more robust (wait for Synapse to settle) #281

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions test/e2e-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2735,10 +2735,13 @@ describe('matrix-viewer', () => {
// doing them serially and the room directory doesn't return the rooms in any
// particular order so it doesn't make the test any more clear doing them
// serially anyway.
let lastCreatedRoomId;
const createdRoomsIds = await Promise.all(
roomsConfigurationsToCreate.map((roomCreateOptions) =>
createTestRoom(client, roomCreateOptions)
)
roomsConfigurationsToCreate.map(async (roomCreateOptions) => {
const roomId = await createTestRoom(client, roomCreateOptions);
lastCreatedRoomId = roomId;
return roomId;
})
);

function roomIdToRoomName(expectedRoomId) {
Expand Down Expand Up @@ -2822,6 +2825,11 @@ describe('matrix-viewer', () => {
client,
searchTerm: visibleRoomConfigurations[visibleRoomConfigurations.length - 1].name,
});
// Also check for the room that we last saw created as an extra measure
await waitForResultsInHomeserverRoomDirectory({
client,
searchTerm: roomIdToRoomName(lastCreatedRoomId),
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass locally:

$ npm run test
[...]
155 passing (44s)

// Visit a sequence of pages using the pagination links: 1 -> 2 -> 3 -> 2 -> 1
const firstPage = await checkRoomsOnPage(testUrl);
Expand Down
Loading