Added tests (#62635)

This commit is contained in:
TheBirb
2020-08-20 08:31:05 +03:00
committed by GitHub
parent bebd7944d5
commit a1097d70ed
2 changed files with 30 additions and 0 deletions

View File

@@ -674,6 +674,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
),
Expanded(
child: ListView(
physics: widget.physics,
padding: const EdgeInsets.all(24.0),
children: <Widget>[
AnimatedSize(

View File

@@ -817,4 +817,33 @@ void main() {
expect(buttonMaterial('CANCEL').color.value, 0);
expect(buttonMaterial('CANCEL').textStyle.color.value, 0x61ffffff);
});
testWidgets('Vertical and Horizontal Stepper physics test', (WidgetTester tester) async {
const ScrollPhysics physics = NeverScrollableScrollPhysics();
for(final StepperType type in StepperType.values) {
await tester.pumpWidget(
MaterialApp(
home: Material(
child: Stepper(
physics: physics,
type: type,
steps: const <Step>[
Step(
title: Text('Step 1'),
content: SizedBox(
width: 100.0,
height: 100.0,
),
),
],
),
),
),
);
final ListView listView = tester.widget<ListView>(find.descendant(of: find.byType(Stepper), matching: find.byType(ListView)));
expect(listView.physics, physics);
}
});
}