mirror of
https://github.com/bitwarden/server.git
synced 2025-12-10 15:55:10 -06:00
[PM-26004] - fix DeleteByOrganizationIdAsync_ExcludesDefaultCollectionCiphers test (#6389)
* fix test * fix test
This commit is contained in:
parent
b9e8b11311
commit
3a6b9564d5
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user