Skip to content

Commit

Permalink
Add test scenario for iCanteen
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Feb 9, 2024
1 parent 8f1f5e3 commit 752c829
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ void main() {
String? name = const String.fromEnvironment("NAME");

testWidgets('Run app and login', (tester) async {
await prep(tester, username, password, name);
await prep(tester, username, password, name, true);
expect(find.text("Username"), findsNothing);
});

testWidgets('Test TimeTable page', (tester) async {
await prep(tester, username, password, name);
await prep(tester, username, password, name, false);

await tester.pump(const Duration(seconds: 1));

Expand All @@ -43,7 +43,7 @@ void main() {
});

testWidgets('Test TimeTable page scroll', (tester) async {
await prep(tester, username, password, name);
await prep(tester, username, password, name, false);

await tester.tap(find.byType(NavigationDestination).at(1));
await tester.pump(const Duration(seconds: 1));
Expand All @@ -68,9 +68,9 @@ void main() {
});
}

Future<void> prep(
WidgetTester tester, String username, String password, String name) async {
SharedPreferences.setMockInitialValues({});
Future<void> prep(WidgetTester tester, String username, String password,
String name, bool enableiCanteen) async {
SharedPreferences.setMockInitialValues({"ice": enableiCanteen});
final FlutterExceptionHandler? originalOnError = FlutterError.onError;
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
Expand Down

0 comments on commit 752c829

Please sign in to comment.