You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-09-13 06:06:34 +03:00
* Implement enough of the new store to get a list of rooms * Make it possible to swap sorting algorithm * Don't attach to window object We don't want the store to be created if the labs flag is off * Remove the store class Probably best to include this PR with the minimal vm implmentation * Create a new room list store that wraps around the skip list * Create a minimal view model * Fix CI * Add some basic tests for the store * Write more tests * Add some jsdoc comments * Add more documentation * Add more docs
22 lines
789 B
TypeScript
22 lines
789 B
TypeScript
/*
|
|
Copyright 2025 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import type { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
|
|
import { mkMessage, mkStubRoom } from "../../../../test-utils";
|
|
|
|
export function getMockedRooms(client: MatrixClient, roomCount: number = 100): Room[] {
|
|
const rooms: Room[] = [];
|
|
for (let i = 0; i < roomCount; ++i) {
|
|
const roomId = `!foo${i}:matrix.org`;
|
|
const room = mkStubRoom(roomId, `Foo Room ${i}`, client);
|
|
const event = mkMessage({ room: roomId, user: `@foo${i}:matrix.org`, ts: i + 1, event: true });
|
|
room.timeline.push(event);
|
|
rooms.push(room);
|
|
}
|
|
return rooms;
|
|
}
|