@@ -168,9 +168,11 @@ public async Task LeaveBoard_ShouldRemoveUserFromPresence()
168168
169169 using var client2 = _factory . CreateClient ( ) ;
170170 var user2 = await ApiTestHarness . AuthenticateAsync ( client2 , "hub-leave2" ) ;
171- await client1 . PostAsJsonAsync (
171+ var grantResponse = await client1 . PostAsJsonAsync (
172172 $ "/api/boards/{ board . Id } /access",
173173 new GrantAccessDto ( board . Id , user2 . UserId , UserRole . Editor ) ) ;
174+ grantResponse . StatusCode . Should ( ) . Be ( HttpStatusCode . OK ,
175+ "granting board access is a precondition for this test" ) ;
174176
175177 // Observer (user1) joins board
176178 var observerEvents = new EventCollector < BoardPresenceSnapshot > ( ) ;
@@ -209,9 +211,11 @@ public async Task AbruptDisconnect_ShouldCleanUpPresence()
209211
210212 using var client2 = _factory . CreateClient ( ) ;
211213 var user2 = await ApiTestHarness . AuthenticateAsync ( client2 , "hub-disc2" ) ;
212- await client1 . PostAsJsonAsync (
214+ var grantResponse = await client1 . PostAsJsonAsync (
213215 $ "/api/boards/{ board . Id } /access",
214216 new GrantAccessDto ( board . Id , user2 . UserId , UserRole . Editor ) ) ;
217+ grantResponse . StatusCode . Should ( ) . Be ( HttpStatusCode . OK ,
218+ "granting board access is a precondition for this test" ) ;
215219
216220 // User1 connects and joins
217221 var events1 = new EventCollector < BoardPresenceSnapshot > ( ) ;
@@ -252,9 +256,11 @@ public async Task MultipleUsersOnSameBoard_ShouldSeeAllMembersInPresence()
252256
253257 using var client2 = _factory . CreateClient ( ) ;
254258 var user2 = await ApiTestHarness . AuthenticateAsync ( client2 , "hub-multi2" ) ;
255- await client1 . PostAsJsonAsync (
259+ var grantResponse = await client1 . PostAsJsonAsync (
256260 $ "/api/boards/{ board . Id } /access",
257261 new GrantAccessDto ( board . Id , user2 . UserId , UserRole . Editor ) ) ;
262+ grantResponse . StatusCode . Should ( ) . Be ( HttpStatusCode . OK ,
263+ "granting board access is a precondition for this test" ) ;
258264
259265 var events1 = new EventCollector < BoardPresenceSnapshot > ( ) ;
260266 await using var conn1 = SignalRTestHelper . CreateBoardsHubConnection ( _factory , user1 . Token ) ;
0 commit comments