Skip to content

Commit

Permalink
- fix test for codemagic
Browse files Browse the repository at this point in the history
  • Loading branch information
spidgorny committed Mar 16, 2019
1 parent 9a1f52c commit 07c4f2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
6 changes: 6 additions & 0 deletions lib/MyHomePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class _MyHomePageState extends State<MyHomePage> {
});
}

@override
void dispose() {
super.dispose();
timer.cancel();
}

void initComeIn() async {
print('await storage.ready');
await storage.ready;
Expand Down
20 changes: 6 additions & 14 deletions test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,16 @@

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:working_time_alert/main.dart';
import 'package:working_time_alert/MyHomePage.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
testWidgets('MyHomePage', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
await tester.pumpWidget(MaterialApp(home: Scaffold(body: MyHomePage())));

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

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

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
expect(find.text('Working Time Today'), findsOneWidget);
await tester.pumpWidget(Container());
await tester.pumpAndSettle();
});
}

0 comments on commit 07c4f2d

Please # to comment.