Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
void main(){
testWidgets('it is possible to validate small widget',
(WidgetTester tester) async {
Widget kiwi = ScopedModel<AppState>(
model: AppState(),
child: ScopedModel<Preferences>(
model: Preferences()..load(),
child: CupertinoApp(
color: Styles.appBackground,
home: VeggieCard(
new Veggie(
shortDescription: "Kiwi is sour.",
category: VeggieCategory.tropical,
accentColor: CupertinoColors.white,
seasons: <Season>[Season.winter],
id: 1,
name: "Kiwi",
imageAssetPath: 'assets/images/kiwi.jpg'),
await tester.pumpWidget(kiwi);
expect(find.text("Kiwi"), findsOneWidget);
expect(find.text("Kiwi is sour."), findsOneWidget);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.