-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more onboarding test and routing tests
- Loading branch information
Showing
12 changed files
with
1,101 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
test/onboarding/verify_phrase/cubit/onboarding_verify_phrase_state_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:altme/app/app.dart'; | ||
import 'package:altme/onboarding/onboarding.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
group('OnBoardingVerifyPhraseState', () { | ||
test('success method returns a new state with updated status and message', | ||
() { | ||
final state = OnBoardingVerifyPhraseState(); | ||
final newState = state.success(messageHandler: ResponseMessage()); | ||
|
||
expect(newState.status, AppStatus.success); | ||
expect(newState.message, isNotNull); | ||
expect(newState.isVerified, state.isVerified); | ||
expect(newState.mnemonicStates, state.mnemonicStates); | ||
}); | ||
|
||
test('toJson and fromJson work correctly', () { | ||
final state = OnBoardingVerifyPhraseState( | ||
status: AppStatus.success, | ||
isVerified: true, | ||
); | ||
|
||
final json = state.toJson(); | ||
final newState = OnBoardingVerifyPhraseState.fromJson(json); | ||
|
||
expect(state, newState); | ||
}); | ||
}); | ||
|
||
group('MnemonicState', () { | ||
test('toJson and fromJson work correctly', () { | ||
const mnemonicState = MnemonicState( | ||
mnemonicStatus: MnemonicStatus.selected, | ||
order: 1, | ||
); | ||
|
||
final json = mnemonicState.toJson(); | ||
final newState = MnemonicState.fromJson(json); | ||
|
||
expect(newState, mnemonicState); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.