Skip to content

Commit beffdad

Browse files
committed
Refactor integration test to validate connectivity stream output
Updated the test to check that the connectivity stream emits a boolean value, reflecting the internet connection status. Removed the previous version string assertion for clarity.
1 parent 51eeb10 commit beffdad

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

example/integration_test/plugin_integration_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import 'package:integration_test/integration_test.dart';
1313
void main() {
1414
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
1515

16-
testWidgets('getPlatformVersion test', (WidgetTester tester) async {
16+
testWidgets('connectivity stream emits boolean', (WidgetTester tester) async {
1717
final ConnectivityValidator plugin = ConnectivityValidator();
18+
// The plugin emits true = validated internet, false = no internet/captive portal.
19+
// CI emulators may have either state; we only assert the stream works and emits a bool.
1820
final bool isConnected = await plugin.onConnectivityChanged.first;
19-
// The version string depends on the host platform running the test, so
20-
// just assert that some non-empty string is returned.
21-
expect(isConnected, true);
21+
expect(isConnected, isA<bool>());
2222
});
2323
}

0 commit comments

Comments
 (0)