Skip to content

Commit

Permalink
Merge branch 'Remember_me_feature' of https://github.com/MohitMaulekh…
Browse files Browse the repository at this point in the history
…i/talawa into Remember_me_feature
  • Loading branch information
MohitMaulekhi committed Dec 25, 2024
2 parents bc024b4 + e7a314d commit fe03e05
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 fe03e05

Please sign in to comment.