@@ -92,6 +92,86 @@ async def test_properties1(flet_app: ftt.FletTestApp, request):
9292
9393@pytest .mark .asyncio (loop_scope = "function" )
9494async def test_properties2 (flet_app : ftt .FletTestApp , request ):
95+ await flet_app .assert_control_screenshot (
96+ request .node .name ,
97+ ft .Column (
98+ [
99+ ft .ListTile (
100+ title = "List Tile with horizontal spacing" ,
101+ subtitle = "Subtitle" ,
102+ leading = ft .Icon (ft .Icons .STAR ),
103+ trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
104+ bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
105+ splash_color = ft .Colors .GREEN_200 , # is not shown on screenshot
106+ hover_color = ft .Colors .YELLOW_200 ,
107+ horizontal_spacing = 50 ,
108+ title_alignment = ft .ListTileTitleAlignment .THREE_LINE ,
109+ ),
110+ ft .ListTile (
111+ title = "List Tile with minimum leading width" ,
112+ subtitle = "Top Title Alignment" ,
113+ is_three_line = True ,
114+ leading = ft .Icon (ft .Icons .STAR ),
115+ trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
116+ bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
117+ splash_color = ft .Colors .GREEN_200 , # is not shown on screenshot
118+ hover_color = ft .Colors .YELLOW_200 ,
119+ min_leading_width = 100 ,
120+ title_alignment = ft .ListTileTitleAlignment .TOP , # default value
121+ ),
122+ ft .ListTile (
123+ title = "List Tile with minimum vertical padding" ,
124+ subtitle = "Center Title Alignment" ,
125+ leading = ft .Icon (ft .Icons .STAR ),
126+ trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
127+ bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
128+ splash_color = ft .Colors .GREEN_200 , # is not shown on screenshot
129+ hover_color = ft .Colors .YELLOW_200 ,
130+ min_vertical_padding = 30 ,
131+ title_alignment = ft .ListTileTitleAlignment .CENTER ,
132+ ),
133+ ft .ListTile (
134+ title = "List Tile with icon color and text color and styles" ,
135+ subtitle = "Bottom Title Alignment" ,
136+ icon_color = ft .Colors .RED ,
137+ text_color = ft .Colors .PURPLE ,
138+ title_text_style = ft .TextStyle (size = 20 , weight = ft .FontWeight .BOLD ),
139+ subtitle_text_style = ft .TextStyle (size = 10 , italic = True ),
140+ leading = ft .Icon (ft .Icons .STAR ),
141+ trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
142+ bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
143+ title_alignment = ft .ListTileTitleAlignment .BOTTOM ,
144+ ),
145+ ft .ListTile (
146+ title = "List Tile with leading and trailing text style" ,
147+ subtitle = "Title Height Title Alignment" ,
148+ icon_color = ft .Colors .PINK ,
149+ leading = ft .Text ("Leading" ),
150+ trailing = ft .Text ("Trailing" ),
151+ leading_and_trailing_text_style = ft .TextStyle (
152+ color = ft .Colors .RED ,
153+ size = 12 ,
154+ ),
155+ bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
156+ title_alignment = ft .ListTileTitleAlignment .TITLE_HEIGHT ,
157+ ),
158+ ft .ListTile (
159+ title = "List Tile with minimum height" ,
160+ subtitle = "Title Height Title Alignment" ,
161+ icon_color = ft .Colors .RED ,
162+ leading = ft .Text ("Leading" ),
163+ trailing = ft .Text ("Trailing" ),
164+ bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
165+ min_height = 150 ,
166+ title_alignment = ft .ListTileTitleAlignment .TITLE_HEIGHT ,
167+ ),
168+ ]
169+ ),
170+ )
171+
172+
173+ @pytest .mark .asyncio (loop_scope = "function" )
174+ async def test_properties3 (flet_app : ftt .FletTestApp , request ):
95175 flet_app .page .enable_screenshots = True
96176 flet_app .page .window .width = 400
97177 flet_app .page .window .height = 600
@@ -135,82 +215,12 @@ async def test_properties2(flet_app: ftt.FletTestApp, request):
135215 visual_density = ft .VisualDensity .COMPACT ,
136216 )
137217
138- lt3 = ft .ListTile (
139- title = "List Tile with horizontal spacing" ,
140- subtitle = "Subtitle" ,
141- leading = ft .Icon (ft .Icons .STAR ),
142- trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
143- bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
144- splash_color = ft .Colors .GREEN_200 , # is not shown on screenshot
145- hover_color = ft .Colors .YELLOW_200 ,
146- horizontal_spacing = 50 ,
147- title_alignment = ft .ListTileTitleAlignment .THREE_LINE , # default value
148- )
149-
150- lt4 = ft .ListTile (
151- title = "List Tile with minimum leading width" ,
152- subtitle = "Top Title Alignment" ,
153- is_three_line = True ,
154- leading = ft .Icon (ft .Icons .STAR ),
155- trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
156- bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
157- splash_color = ft .Colors .GREEN_200 , # is not shown on screenshot
158- hover_color = ft .Colors .YELLOW_200 ,
159- min_leading_width = 100 ,
160- title_alignment = ft .ListTileTitleAlignment .TOP , # default value
161- )
162-
163- lt5 = ft .ListTile (
164- title = "List Tile with minimum vertical padding" ,
165- subtitle = "Center Title Alignment" ,
166- leading = ft .Icon (ft .Icons .STAR ),
167- trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
168- bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
169- splash_color = ft .Colors .GREEN_200 , # is not shown on screenshot
170- hover_color = ft .Colors .YELLOW_200 ,
171- min_vertical_padding = 30 ,
172- title_alignment = ft .ListTileTitleAlignment .CENTER ,
173- )
174-
175- lt6 = ft .ListTile (
176- title = "List Tile with icon color and text color and styles" ,
177- subtitle = "Bottom Title Alignment" ,
178- icon_color = ft .Colors .RED ,
179- text_color = ft .Colors .PURPLE ,
180- title_text_style = ft .TextStyle (size = 20 , weight = ft .FontWeight .BOLD ),
181- subtitle_text_style = ft .TextStyle (size = 10 , italic = True ),
182- leading = ft .Icon (ft .Icons .STAR ),
183- trailing = ft .Icon (ft .Icons .ARROW_FORWARD ),
184- bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
185- title_alignment = ft .ListTileTitleAlignment .BOTTOM ,
186- )
187-
188- lt7 = ft .ListTile (
189- title = "List Tile with leading and trailing text style" ,
190- subtitle = "Title Height Title Alignment" ,
191- icon_color = ft .Colors .RED ,
192- leading = ft .Text ("Leading" ),
193- trailing = ft .Text ("Trailing" ),
194- bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
195- title_alignment = ft .ListTileTitleAlignment .TITLE_HEIGHT ,
196- )
197-
198- lt8 = ft .ListTile (
199- title = "List Tile with minimum height" ,
200- subtitle = "Title Height Title Alignment" ,
201- icon_color = ft .Colors .RED ,
202- leading = ft .Text ("Leading" ),
203- trailing = ft .Text ("Trailing" ),
204- bgcolor = ft .Colors .LIGHT_BLUE_ACCENT_100 ,
205- min_height = 150 ,
206- )
207-
208- flet_app .page .add (lt , lt1 , lt2 , lt3 , lt4 , lt5 , lt6 , lt7 , lt8 )
218+ flet_app .page .add (lt , lt1 , lt2 )
209219 flet_app .page .update ()
210220 await flet_app .tester .pump_and_settle ()
211221
212222 flet_app .assert_screenshot (
213- "properties_2_normal " ,
223+ "properties_3_normal " ,
214224 await flet_app .page .take_screenshot (
215225 pixel_ratio = flet_app .screenshots_pixel_ratio
216226 ),
@@ -223,7 +233,7 @@ async def test_properties2(flet_app: ftt.FletTestApp, request):
223233 await flet_app .tester .pump_and_settle ()
224234
225235 flet_app .assert_screenshot (
226- "properties_2_hover " ,
236+ "properties_3_hover " ,
227237 await flet_app .page .take_screenshot (
228238 pixel_ratio = flet_app .screenshots_pixel_ratio
229239 ),
0 commit comments