|
| 1 | +// Copyright 2023, the Chromium project authors. Please see the AUTHORS file |
| 2 | +// for details. All rights reserved. Use of this source code is governed by a |
| 3 | +// BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +import 'package:firebase_ui_auth/firebase_ui_auth.dart'; |
| 6 | +import 'package:flutter_test/flutter_test.dart'; |
| 7 | + |
| 8 | +import '../test_utils.dart'; |
| 9 | + |
| 10 | +void main() { |
| 11 | + final auth = MockAuth(); |
| 12 | + auth.user = MockUser(providerData: [ |
| 13 | + MockUserInfo(providerId: 'email'), |
| 14 | + MockUserInfo(providerId: 'phone'), |
| 15 | + ]); |
| 16 | + |
| 17 | + group('$ReauthenticateDialog', () { |
| 18 | + testWidgets('has capitalized Cancel label', (tester) async { |
| 19 | + await tester.pumpWidget( |
| 20 | + TestMaterialApp( |
| 21 | + child: ReauthenticateDialog( |
| 22 | + auth: auth, |
| 23 | + providers: [ |
| 24 | + EmailAuthProvider(), |
| 25 | + PhoneAuthProvider(), |
| 26 | + ], |
| 27 | + ), |
| 28 | + ), |
| 29 | + ); |
| 30 | + |
| 31 | + expect(find.text('Cancel'), findsOneWidget); |
| 32 | + }); |
| 33 | + }); |
| 34 | + |
| 35 | + group('$DifferentMethodSignInDialog', () { |
| 36 | + testWidgets('has capitalized Cancel label', (tester) async { |
| 37 | + await tester.pumpWidget( |
| 38 | + TestMaterialApp( |
| 39 | + child: DifferentMethodSignInDialog( |
| 40 | + auth: auth, |
| 41 | + availableProviders: const ['email', 'phone'], |
| 42 | + providers: [ |
| 43 | + EmailAuthProvider(), |
| 44 | + PhoneAuthProvider(), |
| 45 | + ], |
| 46 | + ), |
| 47 | + ), |
| 48 | + ); |
| 49 | + |
| 50 | + expect(find.text('Cancel'), findsOneWidget); |
| 51 | + }); |
| 52 | + }); |
| 53 | +} |
0 commit comments