-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Parent] Account creation error for no self reg/generic (#992)
* [Parent] Account creation error for no self reg/generic * added a test for new error case
- Loading branch information
1 parent
1473f7b
commit 2b962ab
Showing
3 changed files
with
48 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,4 +404,36 @@ void main() { | |
)); | ||
}, a11yExclusions: {A11yExclusion.minTapSize}); | ||
}); | ||
|
||
testWidgetsWithAccessibilityChecks('account creation with error shows generic error message', (tester) async { | ||
when(interactor.getToSForAccount('123', 'hodor.com')).thenAnswer((_) async => tos); | ||
when(interactor.createNewAccount('123', '123', 'hodor', '[email protected]', '12345678', 'hodor.com')) | ||
.thenThrow(DioError(response: Response())); | ||
|
||
await tester.pumpWidget(TestApp(AccountCreationScreen(pairingInfo))); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.enterText(find.widgetWithText(TextFormField, 'Full Name…'), 'hodor'); | ||
await tester.enterText(find.widgetWithText(TextFormField, 'Email…'), '[email protected]'); | ||
await tester.enterText(find.widgetWithText(TextFormField, 'Password…'), '12345678'); | ||
|
||
await tester.drag(find.byType(Scaffold), Offset(0, -500)); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.byType(RaisedButton)); | ||
|
||
await tester.pump(); | ||
await tester.pump(); | ||
await tester.pump(); | ||
|
||
expect( | ||
find.text( | ||
'Something went wrong trying to create your account, please reach out to your school for assistance.'), | ||
findsOneWidget); | ||
verify(analytics.logEvent( | ||
AnalyticsEventConstants.QR_ACCOUNT_FAILURE, | ||
extras: {AnalyticsParamConstants.DOMAIN_PARAM: 'hodor.com'}, | ||
)); | ||
}, a11yExclusions: {A11yExclusion.minTapSize}); | ||
} |