1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[PM-19811] fix ResetPasswordEnrolled check to handle empty and whitespace strings. (#5599)

This commit is contained in:
Jimmy Vo
2025-04-07 17:15:01 -04:00
committed by GitHub
parent a8403f3dc2
commit 91fa02f8e6
3 changed files with 10 additions and 5 deletions

View File

@ -25,11 +25,16 @@ public class MemberResponseModelTests
Assert.True(sut.ResetPasswordEnrolled);
}
[Fact]
public void ResetPasswordEnrolled_ShouldBeFalse_WhenUserDoesNotHaveResetPasswordKey()
[Theory]
[InlineData(null)]
[InlineData("")]
[InlineData(" ")]
public void ResetPasswordEnrolled_ShouldBeFalse_WhenResetPasswordKeyIsInvalid(string? resetPasswordKey)
{
// Arrange
var user = Substitute.For<OrganizationUser>();
user.ResetPasswordKey = resetPasswordKey;
var collections = Substitute.For<IEnumerable<CollectionAccessSelection>>();
// Act