mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
AC 2266 two email notifications is sent when creating org from sm trial (#3878)
* remove the unwanted test Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * Fix the double email issue Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * Resolve the bug issue Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * change the category name Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * move private down the class Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * move the private method down the class file Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * Add the RegisterUser Test Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * modify the test Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * remove the failing test Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * revert the test Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * add the email method Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * revert changes on the UserServiceTests.cs Signed-off-by: Cy Okeke <cokeke@bitwarden.com> --------- Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
@ -2362,55 +2362,6 @@ OrganizationUserInvite invite, SutProvider<OrganizationService> sutProvider)
|
||||
Assert.Contains("custom users can only grant the same custom permissions that they have.", exception.Message.ToLowerInvariant());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[BitAutoData(PlanType.EnterpriseAnnually)]
|
||||
[BitAutoData(PlanType.EnterpriseMonthly)]
|
||||
[BitAutoData(PlanType.TeamsAnnually)]
|
||||
[BitAutoData(PlanType.TeamsMonthly)]
|
||||
public async Task SignUp_EmailSent_When_FromSecretsManagerTrial(PlanType planType, OrganizationSignup signup, SutProvider<OrganizationService> sutProvider)
|
||||
{
|
||||
signup.Plan = planType;
|
||||
|
||||
var plan = StaticStore.GetPlan(signup.Plan);
|
||||
|
||||
signup.UseSecretsManager = true;
|
||||
signup.AdditionalSeats = 15;
|
||||
signup.AdditionalSmSeats = 10;
|
||||
signup.AdditionalServiceAccounts = 20;
|
||||
signup.PaymentMethodType = PaymentMethodType.Card;
|
||||
signup.PremiumAccessAddon = false;
|
||||
signup.IsFromSecretsManagerTrial = true;
|
||||
sutProvider.GetDependency<IFeatureService>().IsEnabled(FeatureFlagKeys.AC2101UpdateTrialInitiationEmail).Returns(true);
|
||||
|
||||
await sutProvider.Sut.SignUpAsync(signup);
|
||||
|
||||
await sutProvider.GetDependency<IMailService>().Received(1).SendTrialInitiationEmailAsync(signup.BillingEmail);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[BitAutoData(PlanType.EnterpriseAnnually)]
|
||||
[BitAutoData(PlanType.EnterpriseMonthly)]
|
||||
[BitAutoData(PlanType.TeamsAnnually)]
|
||||
[BitAutoData(PlanType.TeamsMonthly)]
|
||||
public async Task SignUp_NoEmailSent_When_NotFromSecretsManagerTrial(PlanType planType, OrganizationSignup signup, SutProvider<OrganizationService> sutProvider)
|
||||
{
|
||||
signup.Plan = planType;
|
||||
|
||||
var plan = StaticStore.GetPlan(signup.Plan);
|
||||
|
||||
signup.UseSecretsManager = true;
|
||||
signup.AdditionalSeats = 15;
|
||||
signup.AdditionalSmSeats = 10;
|
||||
signup.AdditionalServiceAccounts = 20;
|
||||
signup.PaymentMethodType = PaymentMethodType.Card;
|
||||
signup.PremiumAccessAddon = false;
|
||||
signup.IsFromSecretsManagerTrial = false;
|
||||
|
||||
await sutProvider.Sut.SignUpAsync(signup);
|
||||
|
||||
await sutProvider.GetDependency<IMailService>().Received(0).SendTrialInitiationEmailAsync(signup.BillingEmail);
|
||||
}
|
||||
|
||||
// Must set real guids in order for dictionary of guids to not throw aggregate exceptions
|
||||
private void SetupOrgUserRepositoryCreateManyAsyncMock(IOrganizationUserRepository organizationUserRepository)
|
||||
{
|
||||
|
Reference in New Issue
Block a user