Skip to content

Instantly share code, notes, and snippets.

@cdmunoz
Last active July 24, 2023 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdmunoz/dec868274ebb9bfe7f133ea444c7d1ec to your computer and use it in GitHub Desktop.
Save cdmunoz/dec868274ebb9bfe7f133ea444c7d1ec to your computer and use it in GitHub Desktop.
group('with a success', () {
setUpAll(() async {
when(pushNotifier.requestPermissions()).thenSucceed(true);
when(pushNotifier.onTokenRefresh()).thenStream(fcmRefreshedToken);
await subject().onInit();
});
test('ask for push permissions', () {
verify(pushNotifier.requestPermissions());
});
test('obtained the push notification token', () {
verify(obtainPushNotificationToken.call());
});
test('refreshed the push notification token', () {
verify(refreshPushNotificationToken.call('fcm-refreshed-token'));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment