1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

[PM-12526] Can Reduce Org's PM seats to be lower than SM seats (#4796)

This commit is contained in:
Jonas Hendrickx
2024-10-01 11:08:10 +02:00
committed by GitHub
parent c94a084c86
commit 84f7cd262c
2 changed files with 25 additions and 6 deletions

View File

@ -1866,6 +1866,20 @@ OrganizationUserInvite invite, SutProvider<OrganizationService> sutProvider)
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.UpdateSubscription(organizationId, 0, null));
}
[Theory, SecretsManagerOrganizationCustomize]
[BitAutoData("You cannot have more Secrets Manager seats than Password Manager seats.", -1)]
public async Task UpdateSubscription_PmSeatAdjustmentLessThanSmSeats_Throws(string expectedMessage,
int seatAdjustment, Organization organization, SutProvider<OrganizationService> sutProvider)
{
organization.Seats = 100;
organization.SmSeats = 100;
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization);
var actual = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSubscription(organization.Id, seatAdjustment, null));
Assert.Contains(expectedMessage, actual.Message);
}
[Theory, PaidOrganizationCustomize]
[BitAutoData(0, 100, null, true, "")]
[BitAutoData(0, 100, 100, true, "")]