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:
parent
80fc0997a4
commit
b8d502be2e
4 changed files with 186 additions and 15 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue