Skip to content

Commit

Permalink
Initial test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mabe committed Jul 21, 2023
1 parent 3724523 commit e259a7f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
channel: 'stable'
- run: flutter pub get
- run: flutter test
# - run: flutter test
# - run: flutter build apk
# - run: flutter build appbundle
40 changes: 40 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ packages:
url: "https://github.com/a-mabe/simple_count_down.git"
source: git
version: "2.2.2"
coverage:
dependency: "direct main"
description:
name: coverage
sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097"
url: "https://pub.dev"
source: hosted
version: "1.6.3"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -281,6 +289,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
logging:
dependency: transitive
description:
name: logging
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -313,6 +329,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
package_config:
dependency: transitive
description:
name: package_config
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
path:
dependency: "direct main"
description:
Expand Down Expand Up @@ -414,6 +438,14 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
source_maps:
dependency: transitive
description:
name: source_maps
sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703"
url: "https://pub.dev"
source: hosted
version: "0.10.12"
source_span:
dependency: transitive
description:
Expand Down Expand Up @@ -534,6 +566,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: ada49637c27973c183dad90beb6bd781eea4c9f5f955d35da172de0af7bd3440
url: "https://pub.dev"
source: hosted
version: "11.8.0"
wakelock:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies:
sqflite_common_ffi: ^2.2.5
wakelock: ^0.6.2
flutter_launcher_icons: ^0.13.1
coverage: ^1.6.3

flutter_launcher_icons:
android: "launcher_icon"
Expand Down
Empty file added test/interval_timer_test.dart
Empty file.
23 changes: 13 additions & 10 deletions test/widget_test.dart → test/workout_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:openhiit/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
testWidgets('Load add workout smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const WorkoutTimer());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);

// Tap the '+' icon and trigger a frame.
// Tap the '+' icon and trigger the add Workout or Timer page.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
await tester.pumpAndSettle();

// Verify that the next page has loaded.
expect(find.text('Interval Timer'), findsOneWidget);
expect(find.text('Workout'), findsOneWidget);

// Tap to add a Workout.
await tester.tap(find.byIcon(Icons.fitness_center));
await tester.pumpAndSettle();

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
// Verify that the next page has loaded.
expect(find.text('Name this workout:'), findsOneWidget);
});
}

0 comments on commit e259a7f

Please sign in to comment.