1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00

[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

View File

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