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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 186 additions and 15 deletions

View file

@ -203,11 +203,19 @@ describe("RoomView", () => {
expect(instance.getHiddenHighlightCount()).toBe(23);
});
it("and feature_dynamic_room_predecessors is enabled it should pass the setting to findPredecessor", async () => {
SettingsStore.setValue("feature_dynamic_room_predecessors", null, SettingLevel.DEVICE, true);
expect(instance.getHiddenHighlightCount()).toBe(0);
expect(room.findPredecessor).toHaveBeenCalledWith(true);
SettingsStore.setValue("feature_dynamic_room_predecessors", null, SettingLevel.DEVICE, null);
describe("and feature_dynamic_room_predecessors is enabled", () => {
beforeEach(() => {
instance.setState({ msc3946ProcessDynamicPredecessor: true });
});
afterEach(() => {
instance.setState({ msc3946ProcessDynamicPredecessor: false });
});
it("should pass the setting to findPredecessor", async () => {
expect(instance.getHiddenHighlightCount()).toBe(0);
expect(room.findPredecessor).toHaveBeenCalledWith(true);
});
});
});