Room list: assign room to section when section is created (#33240)

* feat(rls): return section tag when created

* feat(vm): assign section tag to room when section created

* test: update exisiting tests

* test(e2e): check that room is in section
This commit is contained in:
Florian Duros
2026-04-23 10:18:02 +00:00
committed by GitHub
parent bb4a7e9613
commit 546083bca9
7 changed files with 44 additions and 27 deletions
@@ -1021,11 +1021,10 @@ describe("RoomListStoreV3", () => {
await store.start();
const sectionCreatedListener = jest.fn();
const listsUpdateListener = jest.fn();
store.on(SECTION_CREATED_EVENT, sectionCreatedListener);
store.on(LISTS_UPDATE_EVENT, listsUpdateListener);
await store.createSection();
const tag = await store.createSection();
expect(tag).toBe("element.io.section.test-tag");
expect(sectionCreatedListener).toHaveBeenCalledWith("element.io.section.test-tag");
});
@@ -23,14 +23,15 @@ describe("createSection", () => {
it.each([
[false, "", undefined],
[true, "", undefined],
])("returns undefined when shouldCreate=%s and name='%s'", async (shouldCreate, name, expected) => {
[true, "My Section", expect.stringMatching(/^element\.io\.section\./)],
])("returns %s when shouldCreate=%s and name='%s'", async (shouldCreate, name, expected) => {
jest.spyOn(Modal, "createDialog").mockReturnValue({
finished: Promise.resolve([shouldCreate, name]),
close: jest.fn(),
} as any);
const result = await createSection();
expect(result).toBe(expected);
expect(result).toEqual(expected);
});
it("returns the new tag when section is created", async () => {