Room list: add robustness to custom section loading (#33475)
* refactor: move all access to custom sections settings into `section.ts` * fix: add robustness when getting the order list of custom sections * fix: add robustness when getting the custom section data * fix: ignore malformed section but don't erase them * fix: remove useless await operator * test: add more tests
This commit is contained in:
@@ -154,6 +154,19 @@ describe("RoomListSectionHeaderViewModel", () => {
|
||||
|
||||
expect(vm.getSnapshot().title).toBe("My Section");
|
||||
});
|
||||
|
||||
it("should not update title when tag is not a custom section tag", () => {
|
||||
const vm = new RoomListSectionHeaderViewModel({
|
||||
tag: "m.favourite",
|
||||
title: "Favourites",
|
||||
spaceId: "!space:server",
|
||||
onToggleExpanded,
|
||||
});
|
||||
|
||||
watchCallback();
|
||||
|
||||
expect(vm.getSnapshot().title).toBe("Favourites");
|
||||
});
|
||||
});
|
||||
|
||||
describe("editSection", () => {
|
||||
|
||||
Reference in New Issue
Block a user