Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Dec 19, 2024
1 parent 681d86c commit c656322
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion test/unit_test/model/token/day_password_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void _testDayPasswordToken() {
expect(uriMap[Token.IMAGE], 'example.png');
expect(uriMap[OTPToken.ALGORITHM], 'SHA1');
expect(uriMap[OTPToken.DIGITS], '6');
expect(uriMap[OTPToken.SECRET_BASE32], Encodings.base32.encode(utf8.encode('secret')));
expect(uriMap[OTPToken.SECRET_BASE32], 'secret');
expect(uriMap[TOTPToken.PERIOD_SECONDS], '86400');
});
test('fromJson', () {
Expand Down
6 changes: 3 additions & 3 deletions test/unit_test/model/token/hotp_token_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void _testHotpToken() {
expect(uriMap[Token.PIN], Token.PIN_VALUE_TRUE);
expect(uriMap[Token.IMAGE], 'example.png');
expect(uriMap[OTPToken.ALGORITHM], 'SHA1');
expect(uriMap[OTPToken.SECRET_BASE32], Encodings.base32.encode(utf8.encode('secret')));
expect(uriMap[OTPToken.SECRET_BASE32], 'secret');
expect(uriMap[OTPToken.DIGITS], '6');
expect(uriMap[HOTPToken.COUNTER], '1');
});
Expand All @@ -187,7 +187,7 @@ void _testHotpToken() {
'type': 'HOTP',
'algorithm': 'SHA256',
'digits': 8,
'secret': 'ONSWG4TFOQ======',
'secret': 'secret',
'counter': 5,
'pin': false,
};
Expand All @@ -197,7 +197,7 @@ void _testHotpToken() {
expect(hotpFromJson.issuer, 'issuer');
expect(hotpFromJson.algorithm, Algorithms.SHA256);
expect(hotpFromJson.digits, 8);
expect(hotpFromJson.secret, 'ONSWG4TFOQ======');
expect(hotpFromJson.secret, 'secret');
expect(hotpFromJson.type, 'HOTP');
expect(hotpFromJson.pin, false);
});
Expand Down
3 changes: 1 addition & 2 deletions test/unit_test/model/token/push_token_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,9 @@ void _testPushToken() {
expect(uriMap[Token.LABEL], 'label');
expect(uriMap[Token.ISSUER], 'issuer');
expect(uriMap[Token.SERIAL], 'serial');
expect(uriMap[PushToken.SSL_VERIFY], 'True');
expect(uriMap[PushToken.SSL_VERIFY], '1');
expect(uriMap[PushToken.ENROLLMENT_CREDENTIAL], 'enrollmentCredentials');
expect(uriMap[PushToken.ROLLOUT_URL], 'http://www.example.com');
expect(uriMap[PushToken.TTL_MINUTES], '30');
expect(uriMap[PushToken.VERSION], '1');
});
test('fromJson', () {
Expand Down
4 changes: 2 additions & 2 deletions test/unit_test/model/token/steam_token_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ void _testSteamToken() {
expect(totpUriMap[Token.LABEL], 'label');
expect(totpUriMap[Token.ISSUER], 'issuer');
expect(totpUriMap[Token.OTPAUTH_TYPE], 'STEAM');
expect(totpUriMap[Token.PIN], false);
expect(totpUriMap[Token.PIN], 'False');
expect(totpUriMap[Token.IMAGE], 'example.png');
expect(totpUriMap[OTPToken.SECRET_BASE32], 'ONSWG4TFOQ======');
expect(totpUriMap[OTPToken.SECRET_BASE32], 'secret');
});
test('fromJson', () {
final steamJson = {
Expand Down
8 changes: 4 additions & 4 deletions test/unit_test/model/token/totp_token_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ void _testTotpToken() {
expect(totpUriMap[Token.LABEL], 'label');
expect(totpUriMap[Token.ISSUER], 'issuer');
expect(totpUriMap[Token.OTPAUTH_TYPE], 'TOTP');
expect(totpUriMap[Token.PIN], false);
expect(totpUriMap[Token.PIN], 'False');
expect(totpUriMap[Token.IMAGE], 'example.png');
expect(totpUriMap[OTPToken.ALGORITHM], 'SHA1');
expect(totpUriMap[OTPToken.DIGITS], 6);
expect(totpUriMap[OTPToken.SECRET_BASE32], 'ONSWG4TFOQ======');
expect(totpUriMap[TOTPToken.PERIOD_SECONDS], 30);
expect(totpUriMap[OTPToken.DIGITS], '6');
expect(totpUriMap[OTPToken.SECRET_BASE32], 'secret');
expect(totpUriMap[TOTPToken.PERIOD_SECONDS], '30');
});
test('fromJson', () {
final totpJson = {
Expand Down

0 comments on commit c656322

Please sign in to comment.