@@ -948,6 +948,46 @@ void main() {
948
948
949
949
check (state.loading).isFalse ();
950
950
});
951
+
952
+ testWidgets ('in idle state' , (WidgetTester tester) async {
953
+ final child = Container ();
954
+
955
+ await tester.pumpWidget (MaterialApp (
956
+ home: MarkAsReadAnimation (hidden: false , loading: false , child: child)));
957
+
958
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
959
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (1 );
960
+ });
961
+
962
+ testWidgets ('in loading state' , (WidgetTester tester) async {
963
+ final child = Container ();
964
+
965
+ await tester.pumpWidget (MaterialApp (
966
+ home: MarkAsReadAnimation (hidden: false , loading: true , child: child)));
967
+
968
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
969
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0.5 );
970
+ });
971
+
972
+ testWidgets ('in hidden state' , (WidgetTester tester) async {
973
+ final child = Container ();
974
+
975
+ await tester.pumpWidget (MaterialApp (
976
+ home: MarkAsReadAnimation (hidden: true , loading: false , child: child)));
977
+
978
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
979
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0 );
980
+ });
981
+
982
+ testWidgets ('in hidden state but loading is true' , (WidgetTester tester) async {
983
+ final child = Container ();
984
+
985
+ await tester.pumpWidget (MaterialApp (
986
+ home: MarkAsReadAnimation (hidden: true , loading: true , child: child)));
987
+
988
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
989
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0 );
990
+ });
951
991
});
952
992
953
993
testWidgets ('smoke test on modern server' , (WidgetTester tester) async {
0 commit comments