1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Support dynamic room predecessors in RoomNotificationStateStore (#10297)

* Tests for RoomNotificationStateStore emitting events

* Support dynamic room predecessors in RoomNotificationStateStore

* Remove unused arguments from emit call.

UPDATE_STATUS_INDICATOR is used in:
* SpacePanel
* MatrixChat
* RoomHeaderButtons

but these arguments are not used in any of those places. Remove them so
when I refactor I don't have to make up values for them.

* Fix broken test (wrong expected args to emit)

UPDATE_STATUS_INDICATOR is used in:
* SpacePanel
* MatrixChat
* RoomHeaderButtons

but these arguments are not used in any of those places. Remove them so
when I refactor I don't have to make up values for them.

* Update the RoomNotificationStore whenever the predecessor labs flag changes

* Fix type errors

* Fix other tests that trigger our new watcher
This commit is contained in:
Andy Balaam
2023-03-08 14:18:03 +00:00
committed by GitHub
parent 80fc0997a4
commit b8d502be2e
4 changed files with 186 additions and 15 deletions

View File

@@ -198,11 +198,17 @@ describe("Spotlight Dialog", () => {
describe("when MSC3946 dynamic room predecessors is enabled", () => {
beforeEach(() => {
SettingsStore.setValue("feature_dynamic_room_predecessors", null, SettingLevel.DEVICE, true);
jest.spyOn(SettingsStore, "getValue").mockImplementation((settingName, roomId, excludeDefault) => {
if (settingName === "feature_dynamic_room_predecessors") {
return true;
} else {
return []; // SpotlightSearch.recentSearches
}
});
});
afterEach(() => {
SettingsStore.setValue("feature_dynamic_room_predecessors", null, SettingLevel.DEVICE, null);
jest.restoreAllMocks();
});
it("should call getVisibleRooms with MSC3946 dynamic room predecessors", async () => {