Improve TUI OTP readability
This commit is contained in:
@@ -478,7 +478,14 @@ fn automatic_code_supports_pass_diff_config_and_opens_git_only_for_hotp() -> Tes
|
||||
let totp = service.code_automatic("otp/totp", 59, None, &mut provider)?;
|
||||
assert_eq!(totp.counter(), None);
|
||||
assert_eq!(totp.valid_until(), Some(60));
|
||||
assert_eq!(totp.validity(), OtpCodeValidity::Timed { valid_until: 60 });
|
||||
assert_eq!(
|
||||
totp.validity(),
|
||||
OtpCodeValidity::Timed {
|
||||
valid_until: 60,
|
||||
period: 30,
|
||||
}
|
||||
);
|
||||
assert_eq!(totp.validity().period(), Some(30));
|
||||
assert_eq!(totp.remaining_at(59), Some(1));
|
||||
assert_eq!(totp.remaining_at(60), Some(0));
|
||||
assert_eq!(repository.read_entry(&totp_path)?, totp_before);
|
||||
@@ -494,6 +501,7 @@ fn automatic_code_supports_pass_diff_config_and_opens_git_only_for_hotp() -> Tes
|
||||
OtpCodeValidity::CounterBased { counter: 1 }
|
||||
);
|
||||
assert_eq!(hotp.remaining_at(0), None);
|
||||
assert_eq!(hotp.validity().period(), None);
|
||||
assert_eq!(service.uri("otp/hotp", &mut provider)?.counter(), Some(1));
|
||||
let git = GitRepository::open(&repository, identity)?;
|
||||
assert_eq!(git.log(None)?.len(), initial_commits + 1);
|
||||
|
||||
Reference in New Issue
Block a user