@@ -813,6 +813,46 @@ void main() {
813
813
814
814
check (state.loading).isFalse ();
815
815
});
816
+
817
+ testWidgets ('in idle state' , (WidgetTester tester) async {
818
+ final child = Container ();
819
+
820
+ await tester.pumpWidget (MaterialApp (
821
+ home: MarkAsReadAnimation (hidden: false , loading: false , child: child)));
822
+
823
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
824
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (1 );
825
+ });
826
+
827
+ testWidgets ('in loading state' , (WidgetTester tester) async {
828
+ final child = Container ();
829
+
830
+ await tester.pumpWidget (MaterialApp (
831
+ home: MarkAsReadAnimation (hidden: false , loading: true , child: child)));
832
+
833
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
834
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0.5 );
835
+ });
836
+
837
+ testWidgets ('in hidden state' , (WidgetTester tester) async {
838
+ final child = Container ();
839
+
840
+ await tester.pumpWidget (MaterialApp (
841
+ home: MarkAsReadAnimation (hidden: true , loading: false , child: child)));
842
+
843
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
844
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0 );
845
+ });
846
+
847
+ testWidgets ('in hidden state but loading is true' , (WidgetTester tester) async {
848
+ final child = Container ();
849
+
850
+ await tester.pumpWidget (MaterialApp (
851
+ home: MarkAsReadAnimation (hidden: true , loading: true , child: child)));
852
+
853
+ check (find.byWidget (child).evaluate ()).length.equals (1 );
854
+ check (tester.widget <AnimatedOpacity >(find.byType (AnimatedOpacity )).opacity).equals (0 );
855
+ });
816
856
});
817
857
818
858
testWidgets ('smoke test on modern server' , (WidgetTester tester) async {
0 commit comments