Skip to content

Commit 6012733

Browse files
committed
Added test for icon
1 parent 6c04a5f commit 6012733

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
20 KB
Loading
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import pytest
2+
3+
import flet as ft
4+
import flet.testing as ftt
5+
6+
7+
@pytest.mark.asyncio(loop_scope="module")
8+
async def test_icon_basic(flet_app: ftt.FletTestApp, request):
9+
flet_app.page.theme_mode = ft.ThemeMode.LIGHT
10+
await flet_app.assert_control_screenshot(
11+
request.node.name,
12+
ft.Column(
13+
[ # material
14+
ft.Row(
15+
controls=[
16+
ft.Icon(ft.Icons.ABC, color=ft.Colors.PINK),
17+
ft.Icon(
18+
ft.Icons.AUDIOTRACK, color=ft.Colors.GREEN_400, size=30
19+
),
20+
ft.Icon(ft.Icons.AC_UNIT, color=ft.Colors.BLUE, size=50),
21+
ft.Icon(ft.Icons.SETTINGS, color="#c1c1c1"),
22+
ft.Icon(ft.Icons.ALARM, size=40),
23+
]
24+
),
25+
# cupertino
26+
ft.Row(
27+
controls=[
28+
ft.Icon(ft.CupertinoIcons.AIRPLANE, color=ft.Colors.PINK),
29+
ft.Icon(
30+
icon=ft.CupertinoIcons.CUBE_BOX,
31+
color=ft.Colors.GREEN_400,
32+
size=30,
33+
),
34+
ft.Icon(
35+
icon=ft.CupertinoIcons.ARCHIVEBOX,
36+
color=ft.Colors.BLUE,
37+
size=50,
38+
),
39+
ft.Icon(icon=ft.CupertinoIcons.BAG, color="#c1c1c1"),
40+
ft.Icon(ft.CupertinoIcons.ALARM, size=40),
41+
]
42+
),
43+
]
44+
),
45+
)

0 commit comments

Comments
 (0)