summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorShay <hillerys@element.io>2024-03-19 10:55:31 -0700
committerGitHub <noreply@github.com>2024-03-19 17:55:31 +0000
commitcf5adc80e1a362eb651abdb6d84b2397434a7f45 (patch)
tree5f75e6308ac011df789b868854ea3149309f36de /tests
parentImprove event validation (#16908) (diff)
downloadsynapse-cf5adc80e1a362eb651abdb6d84b2397434a7f45.tar.xz
Update power level default for public rooms (#16907)
Diffstat (limited to 'tests')
-rw-r--r--tests/rest/client/test_rooms.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/rest/client/test_rooms.py b/tests/rest/client/test_rooms.py
index d2f2ded487..1364615085 100644
--- a/tests/rest/client/test_rooms.py
+++ b/tests/rest/client/test_rooms.py
@@ -93,6 +93,7 @@ class RoomPermissionsTestCase(RoomBase):
     rmcreator_id = "@notme:red"
 
     def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
+        self.store_controllers = hs.get_storage_controllers()
         self.helper.auth_user_id = self.rmcreator_id
         # create some rooms under the name rmcreator_id
         self.uncreated_rmid = "!aa:test"
@@ -482,6 +483,23 @@ class RoomPermissionsTestCase(RoomBase):
             expect_code=HTTPStatus.OK,
         )
 
+    def test_default_call_invite_power_level(self) -> None:
+        pl_event = self.get_success(
+            self.store_controllers.state.get_current_state_event(
+                self.created_public_rmid, EventTypes.PowerLevels, ""
+            )
+        )
+        assert pl_event is not None
+        self.assertEqual(50, pl_event.content.get("m.call.invite"))
+
+        private_pl_event = self.get_success(
+            self.store_controllers.state.get_current_state_event(
+                self.created_rmid, EventTypes.PowerLevels, ""
+            )
+        )
+        assert private_pl_event is not None
+        self.assertEqual(None, private_pl_event.content.get("m.call.invite"))
+
 
 class RoomStateTestCase(RoomBase):
     """Tests /rooms/$room_id/state."""