@@ -801,6 +801,46 @@ void main() {
801801
802802 check (state.loading).isFalse ();
803803 });
804+
805+ testWidgets ('in idle state' , (WidgetTester tester) async {
806+ final child = Container ();
807+
808+ await tester.pumpWidget (MaterialApp (
809+ home: MarkAsReadAnimation (hidden: false , loading: false , child: child)));
810+
811+ check (find.byWidget (child).evaluate ()).length.equals (1 );
812+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (1 );
813+ });
814+
815+ testWidgets ('in loading state' , (WidgetTester tester) async {
816+ final child = Container ();
817+
818+ await tester.pumpWidget (MaterialApp (
819+ home: MarkAsReadAnimation (hidden: false , loading: true , child: child)));
820+
821+ check (find.byWidget (child).evaluate ()).length.equals (1 );
822+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0.55 );
823+ });
824+
825+ testWidgets ('in hidden state' , (WidgetTester tester) async {
826+ final child = Container ();
827+
828+ await tester.pumpWidget (MaterialApp (
829+ home: MarkAsReadAnimation (hidden: true , loading: false , child: child)));
830+
831+ check (find.byWidget (child).evaluate ()).length.equals (1 );
832+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0 );
833+ });
834+
835+ testWidgets ('in hidden state but loading is true' , (WidgetTester tester) async {
836+ final child = Container ();
837+
838+ await tester.pumpWidget (MaterialApp (
839+ home: MarkAsReadAnimation (hidden: true , loading: true , child: child)));
840+
841+ check (find.byWidget (child).evaluate ()).length.equals (1 );
842+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0 );
843+ });
804844 });
805845
806846 testWidgets ('smoke test on modern server' , (WidgetTester tester) async {
0 commit comments