From 53bc10015fd020ef84371b3ee83813441cd8fb5d Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 31 Dec 2025 14:06:39 +1000 Subject: [PATCH] Assert semaphores in Create tests --- .../CollectionRepository/CreateDefaultCollectionsTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Infrastructure.IntegrationTest/AdminConsole/Repositories/CollectionRepository/CreateDefaultCollectionsTests.cs b/test/Infrastructure.IntegrationTest/AdminConsole/Repositories/CollectionRepository/CreateDefaultCollectionsTests.cs index a549aea80e..5f81035b0c 100644 --- a/test/Infrastructure.IntegrationTest/AdminConsole/Repositories/CollectionRepository/CreateDefaultCollectionsTests.cs +++ b/test/Infrastructure.IntegrationTest/AdminConsole/Repositories/CollectionRepository/CreateDefaultCollectionsTests.cs @@ -40,6 +40,9 @@ public class CreateDefaultCollectionsTests Assert.All(defaultCollections, c => Assert.Equal("My Items", c.Item1.Name)); Assert.All(defaultCollections, c => Assert.Equal(organization.Id, c.Item1.OrganizationId)); + var semaphores = await collectionRepository.GetDefaultCollectionSemaphoresAsync(organization.Id); + Assert.Equal([orgUser1.Id, orgUser2.Id], semaphores.ToHashSet()); + // Verify each user has exactly 1 collection with correct permissions var orgUser1Collection = Assert.Single(defaultCollections, c => c.Item2.Users.FirstOrDefault()?.Id == orgUser1.Id); @@ -97,6 +100,9 @@ public class CreateDefaultCollectionsTests Assert.Single(defaultCollections); + var semaphores = await collectionRepository.GetDefaultCollectionSemaphoresAsync(organization.Id); + Assert.Equal([orgUser.Id], semaphores); + var access = await collectionRepository.GetManyUsersByIdAsync(defaultCollections.Single().Id); var userAccess = Assert.Single(access); Assert.Equal(orgUser.Id, userAccess.Id);