Skip to content

Commit

Permalink
Fix goldens
Browse files Browse the repository at this point in the history
  • Loading branch information
JvnSlv committed Feb 3, 2025
1 parent e6def9e commit 99bbdc3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ SmsCodeService createSmsCodeService() {
.thenAnswer((_) async => false);

when(mockCreatePinCodeService.getValidityTime(any))
.thenAnswer((_) async => 15);
.thenAnswer((_) async => 1);

when(mockCreatePinCodeService.getResendButtonThrottleTime(any))
.thenAnswer((_) async => 10);
.thenAnswer((_) async => 1);

return mockCreatePinCodeService;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ import '../../helpers/golden_helper.dart';
import '../factory/onboarding_phone_confirm_factory.dart';

void main() {
group('onboarding phone confirm', () {
runGoldenTests([
buildScenario(
scenario: 'onboarding_phone_confirm_empty',
widget: onboardingPhoneConfirmFactory(),
),
buildScenario(
scenario: 'onboarding_phone_confirm_error',
runGoldenTests([
buildScenario(
scenario: 'onboarding_phone_confirmation_empty',
widget: onboardingPhoneConfirmFactory(),
customPumpBeforeTest: (tester) =>
tester.pumpAndSettle(const Duration(seconds: 2)),
),
buildScenario(
scenario: 'onboarding_phone_confirmation_error',
widget: onboardingPhoneConfirmFactory(
errors: UnknownErrorModel(
exception: Exception('Something went wrong'),
),
),
),
]);
});
customPumpBeforeTest: (tester) =>
tester.pumpAndSettle(const Duration(seconds: 2))),
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,8 @@ Future<void> pumpScenarioBuilderWithMaterialApp(
NavigatorObserver? navigatorObserver,
Iterable<Locale>? localeOverrides,
ThemeData? theme,
}) async {
await tester.runAsync(
() async => await onlyPumpWidget(
}) async {
await onlyPumpWidget(
tester,
_buildMaterialAppWrapper(
child: widget,
Expand All @@ -215,7 +214,6 @@ Future<void> pumpScenarioBuilderWithMaterialApp(
navigatorObserver: navigatorObserver,
localeOverrides: localeOverrides,
theme: theme,
),
),
);
}
Expand Down

0 comments on commit 99bbdc3

Please sign in to comment.