Skip to content

Commit

Permalink
Merge branch 'develop-postgres' into unit_test_event_service
Browse files Browse the repository at this point in the history
  • Loading branch information
MohitMaulekhi authored Dec 23, 2024
2 parents 0493c5b + db0d597 commit 89c2e73
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions test/view_model_tests/progress_dialog_view_model_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});
}

0 comments on commit 89c2e73

Please sign in to comment.