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
dddf818
commit 7267a3e
Showing
7 changed files
with
140 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,9 @@ doc/api/ | |
*.js_ | ||
*.js.deps | ||
*.js.map | ||
android | ||
ios | ||
linux | ||
macos | ||
windows | ||
web |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,19 @@ | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:how_old_am_i/screens/home_screen.dart'; | ||
|
||
void main() { | ||
testWidgets('MainScreen displays the form correctly', (tester) async { | ||
await tester.pumpWidget(const MaterialApp(home: MainScreen())); | ||
|
||
final form = tester.widget<Form>(find.byType(Form)); | ||
expect(form, isNotNull); | ||
|
||
final textFields = tester.widgetList<TextField>(find.byType(TextField)); | ||
expect(textFields.length, 3); | ||
|
||
final textFieldTitles = textFields.map((textField) => textField.decoration?.hintText).toList(); | ||
expect(textFieldTitles, ['Day', 'Month', 'Year']); | ||
}); | ||
} |