forked from firebase/FirebaseUI-Flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregister_screen_test.dart
47 lines (40 loc) · 1.27 KB
/
register_screen_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2023, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import '../test_utils.dart';
void main() {
group("$RegisterScreen", () {
setUpAll(() {
setFirebaseUiIsTestMode(true);
});
testWidgets(
"doesn't have password visibility toggle by default",
(tester) async {
await tester.pumpWidget(
TestMaterialApp(
child: RegisterScreen(
auth: MockAuth(),
providers: [EmailAuthProvider()],
),
),
);
expect(find.byIcon(Icons.visibility), findsNothing);
},
);
testWidgets('allows to add password visibility toggle', (tester) async {
await tester.pumpWidget(
TestMaterialApp(
child: RegisterScreen(
auth: MockAuth(),
providers: [EmailAuthProvider()],
showPasswordVisibilityToggle: true,
),
),
);
expect(find.byIcon(Icons.visibility), findsNWidgets(2));
});
});
}