mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 10:11:27 +00:00
added test for issue #979
This commit is contained in:
@@ -31,8 +31,7 @@ public class PasswordStrengthUtil {
|
||||
public PasswordStrengthUtil(ResourceBundle resourceBundle) {
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.zxcvbn = new Zxcvbn();
|
||||
this.sanitizedInputs = new ArrayList<>();
|
||||
this.sanitizedInputs.add("cryptomator");
|
||||
this.sanitizedInputs = List.of("cryptomator");
|
||||
}
|
||||
|
||||
public int computeRate(String password) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.cryptomator.ui.common;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
@@ -18,5 +19,15 @@ public class PasswordStrengthUtilTest {
|
||||
util.computeRate(longPw);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled("waiting on upstream fix")
|
||||
public void testIssue979() {
|
||||
PasswordStrengthUtil util = new PasswordStrengthUtil(Mockito.mock(ResourceBundle.class));
|
||||
int result1 = util.computeRate("backed derrick buckling mountains glove client procedures desire destination sword hidden ram");
|
||||
int result2 = util.computeRate("backed derrick buckling mountains glove client procedures desire destination sword hidden ram escalation");
|
||||
Assertions.assertEquals(4, result1);
|
||||
Assertions.assertEquals(4, result2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user