-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11137a6
commit 0c0ca49
Showing
4 changed files
with
60 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:app/menu.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:app/main.dart'; | ||
|
||
void main() { | ||
testWidgets('Open drawer and close it', (WidgetTester tester) async { | ||
// Build our app and trigger a frame. | ||
await tester.pumpWidget(const MyApp()); | ||
|
||
// Appbar is rendered | ||
expect(find.byKey(appBarKey).hitTestable(), findsOneWidget); | ||
expect(find.byKey(drawerMenuKey).hitTestable(), findsNothing); | ||
|
||
await tester.tap(find.byKey(iconKey)); | ||
await tester.pumpAndSettle(); | ||
|
||
// Expect drawer menu to be shown | ||
expect(find.byKey(drawerMenuKey).hitTestable(), findsOneWidget); | ||
|
||
await tester.tap(find.byKey(closeMenuKey)); | ||
await tester.pumpAndSettle(); | ||
|
||
// Expect drawer menu to be closed | ||
expect(find.byKey(drawerMenuKey).hitTestable(), findsNothing); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters