mirror of
https://github.com/flutter/samples.git
synced 2026-03-21 20:08:16 +00:00
Fixes CI ahead of next release
This commit is contained in:
@@ -33,20 +33,24 @@ class _ResizeAppState extends State<ResizeApp> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
for (int i = 0; i < _listSize; i++)
|
||||
Container(color: HSVColor.fromAHSV(1, (10.0 * i), 1, 1).toColor(), height: 50, width: 200,
|
||||
Container(
|
||||
color: HSVColor.fromAHSV(1, (10.0 * i), 1, 1).toColor(),
|
||||
height: 50,
|
||||
width: 200,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Flutter Widget $i',
|
||||
style: const TextStyle(fontSize: 16, color: Colors.black),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: _addToList,
|
||||
child: Text('Listception!'),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,27 +21,30 @@ class MockCounterModel extends ChangeNotifier implements CounterModel {
|
||||
}
|
||||
|
||||
void main() {
|
||||
testWidgets('MiniView smoke test', (tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: ChangeNotifierProvider<CounterModel>.value(
|
||||
value: MockCounterModel(),
|
||||
child: const Contents(),
|
||||
testWidgets(
|
||||
'MiniView smoke test',
|
||||
(tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: ChangeNotifierProvider<CounterModel>.value(
|
||||
value: MockCounterModel(),
|
||||
child: const Contents(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('Taps: 0'), findsOneWidget);
|
||||
expect(find.text('Taps: 1'), findsNothing);
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('Taps: 0'), findsOneWidget);
|
||||
expect(find.text('Taps: 1'), findsNothing);
|
||||
|
||||
// Tap the '+' icon and trigger a frame.
|
||||
await tester.tap(find.text('Tap me!'));
|
||||
await tester.pump();
|
||||
// Tap the '+' icon and trigger a frame.
|
||||
await tester.tap(find.text('Tap me!'));
|
||||
await tester.pump();
|
||||
|
||||
// Verify that our counter has incremented.
|
||||
expect(find.text('Taps: 0'), findsNothing);
|
||||
expect(find.text('Taps: 1'), findsOneWidget);
|
||||
});
|
||||
// Verify that our counter has incremented.
|
||||
expect(find.text('Taps: 0'), findsNothing);
|
||||
expect(find.text('Taps: 1'), findsOneWidget);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user