Skip to content

Commit

Permalink
refacto: ConnectivityStreamProvider tests in its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
tanguymossion committed Aug 22, 2024
1 parent a4de85a commit 586a1f2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
18 changes: 18 additions & 0 deletions test/src/connectivity_stream_provider_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_community_extensions/src/connectivity_stream_provider.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();

group('ConnectivityStreamProvider tests', () {
test('connectivityStreamProvider provides an AsyncValue', () {
final container = ProviderContainer();
final providerState = container.read(connectivityStreamProvider);

// Check that the initial state is AsyncLoading.
expect(providerState, isA<AsyncLoading<List<ConnectivityResult>>>());
});
});
}
10 changes: 0 additions & 10 deletions test/src/refresh_when_network_available_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,4 @@ void main() {
expect(numberOfFetchDataCalls, 2);
});
});

group('ConnectivityStreamProvider tests', () {
test('connectivityStreamProvider provides an AsyncValue', () {
final container = ProviderContainer();
final providerState = container.read(connectivityStreamProvider);

// Check that the initial state is AsyncLoading.
expect(providerState, isA<AsyncLoading<List<ConnectivityResult>>>());
});
});
}

0 comments on commit 586a1f2

Please sign in to comment.