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:
@ -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, "")]
|
||||
|
Reference in New Issue
Block a user