@@ -24,18 +24,29 @@ void main() {
2424 verifyNever (() => tapFunction.call (any ()));
2525 final currentFinder = find.byKey (iconKey (current));
2626 final nextFinder = find.byKey (iconKey (next));
27+ final switchFinder = find.byType (AnimatedToggleSwitch <int >);
2728
2829 await tester.tap (currentFinder, warnIfMissed: false );
2930 verify (() => tapFunction (any (
3031 that: isA <TapInfo <int >>()
31- .having ((i) => i.tappedValue, 'value ' , current)))).called (1 );
32+ .having ((i) => i.tappedValue, 'tappedValue ' , current)))).called (1 );
3233
3334 await tester.tap (nextFinder, warnIfMissed: false );
3435 verify (() => changedFunction (next)).called (1 );
3536 verify (() => tapFunction (any (
3637 that: isA <TapInfo <int >>()
37- .having ((i) => i.tappedValue, 'value ' , next)))).called (1 );
38+ .having ((i) => i.tappedValue, 'tappedValue ' , next)))).called (1 );
3839
40+ // tap on the border
41+ await tester.tapAt (
42+ (tester.getTopLeft (switchFinder) + tester.getBottomLeft (switchFinder)) /
43+ 2 );
44+ verify (() => tapFunction (any (
45+ that: isA <TapInfo <int >>()
46+ .having ((i) => i.tappedValue, 'tappedValue' , null )
47+ .having ((i) => i.tappedIndex, 'tappedIndex' , - 1 )))).called (1 );
48+
49+ verifyNoMoreInteractions (tapFunction);
3950 verifyNoMoreInteractions (changedFunction);
4051 }, testDual: false );
4152
0 commit comments