diff --git a/test/view_model_tests/progress_dialog_view_model_test.dart b/test/view_model_tests/progress_dialog_view_model_test.dart index 08d490f80..60d2cb0cb 100644 --- a/test/view_model_tests/progress_dialog_view_model_test.dart +++ b/test/view_model_tests/progress_dialog_view_model_test.dart @@ -10,18 +10,35 @@ import '../helpers/test_helpers.dart'; void main() { group('ProgressDialogViewModelTest -', () { group('initialise -', () { - getAndRegisterConnectivity(); - AppConnectivity.isOnline = true; - - final model = ProgressDialogViewModel(); + setUp(() { + getAndRegisterConnectivity(); + }); test( 'When called and connectivity is present, connectivityPresent must be set to true', () async { + // Simulate online state + AppConnectivity.isOnline = true; + + final model = ProgressDialogViewModel(); + await model.initialise(); expect(model.connectivityPresent, true); }); + + test( + 'When called and connectivity is absent, connectivityPresent must be set to false', + () async { + // Simulate offline state + AppConnectivity.isOnline = false; + + final model = ProgressDialogViewModel(); + + await model.initialise(); + + expect(model.connectivityPresent, false); + }); }); }); }