[PM-26004] - fix DeleteByOrganizationIdAsync_ExcludesDefaultCollectionCiphers test (#6389)

* fix test

* fix test
This commit is contained in:
Jordan Aasen 2025-09-26 14:30:34 -07:00 committed by GitHub
parent b9e8b11311
commit 3a6b9564d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1290,12 +1290,16 @@ public class CipherRepositoryTests
var cipherInBothCollections = await CreateOrgCipherAsync(); var cipherInBothCollections = await CreateOrgCipherAsync();
var unassignedCipher = await CreateOrgCipherAsync(); var unassignedCipher = await CreateOrgCipherAsync();
await collectionCipherRepository.UpdateCollectionsForAdminAsync(cipherInDefaultCollection.Id, organization.Id, async Task LinkCollectionCipherAsync(Guid cipherId, Guid collectionId) =>
new List<Guid> { defaultCollection.Id }); await collectionCipherRepository.AddCollectionsForManyCiphersAsync(
await collectionCipherRepository.UpdateCollectionsForAdminAsync(cipherInSharedCollection.Id, organization.Id, organization.Id,
new List<Guid> { sharedCollection.Id }); new[] { cipherId },
await collectionCipherRepository.UpdateCollectionsForAdminAsync(cipherInBothCollections.Id, organization.Id, new[] { collectionId });
new List<Guid> { defaultCollection.Id, sharedCollection.Id });
await LinkCollectionCipherAsync(cipherInDefaultCollection.Id, defaultCollection.Id);
await LinkCollectionCipherAsync(cipherInSharedCollection.Id, sharedCollection.Id);
await LinkCollectionCipherAsync(cipherInBothCollections.Id, defaultCollection.Id);
await LinkCollectionCipherAsync(cipherInBothCollections.Id, sharedCollection.Id);
await cipherRepository.DeleteByOrganizationIdAsync(organization.Id); await cipherRepository.DeleteByOrganizationIdAsync(organization.Id);
@ -1402,3 +1406,4 @@ public class CipherRepositoryTests
Assert.Empty(remainingCollectionCiphers); Assert.Empty(remainingCollectionCiphers);
} }
} }