Skip to content

Commit f64c8ab

Browse files
committed
ensureVisible
1 parent 50783c0 commit f64c8ab

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

integration_test/dummy_test.dart

+10-11
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,29 @@ void main() {
1414
app.main(env: "dev");
1515
await tester.pumpAndSettle(Duration(seconds: 3));
1616

17-
// Expect notification permission being asked
18-
/*final notificationPermissionDialog = find.text('to send you notifications');
19-
expect(notificationPermissionDialog, findsOneWidget);
20-
final allowButton = find.text('Allow');
21-
await tester.tap(allowButton);
22-
await tester.pumpAndSettle();*/
23-
2417
// New user is created: Show consent form
2518
final acceptConditionsCheckbox =
2619
find.byKey(ValueKey("acceptConditionsCheckbox"));
20+
await tester.ensureVisible(acceptConditionsCheckbox);
2721
await tester.tap(acceptConditionsCheckbox);
22+
2823
final acceptPrivacyPolicy = find.byKey(ValueKey("acceptPrivacyPolicy"));
24+
await tester.ensureVisible(acceptPrivacyPolicy);
2925
await tester.tap(acceptPrivacyPolicy);
26+
3027
await tester.pumpAndSettle();
28+
3129
final continueButton = find.byKey(ValueKey(
3230
"button")); // TODO: Using Style.button prevents adding a Key to only this element
3331
await tester.tap(continueButton);
3432
await tester.pumpAndSettle();
3533

34+
// TODO: Mock needed to set the location as always allowed?
3635
// Home page
37-
//final homePageButtons = find.byType(CustomCard);
38-
//expect(homePageButtons, findsNWidgets(4));
39-
// await tester.tap(homePageButtons.at(0));
40-
// await tester.pumpAndSettle();
36+
final homePageButtons = find.byType(CustomCard);
37+
expect(homePageButtons, findsNWidgets(4));
38+
await tester.tap(homePageButtons.at(0));
39+
await tester.pumpAndSettle();
4140

4241
expect(true, true);
4342
});

lib/utils/PushNotificationsManager.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PushNotificationsManager {
3232
*/
3333
static Future<void> init() async {
3434
if (!_initialized) {
35-
//await _firebaseMessaging.requestPermission();
35+
await _firebaseMessaging.requestPermission();
3636

3737
FirebaseMessaging.onMessage.listen((RemoteMessage remoteMessage) {
3838
launchMessage(remoteMessage);

0 commit comments

Comments
 (0)