Skip to content

Commit 930c3ec

Browse files
committed
CupertinoNavigationBar test
1 parent cf9cc45 commit 930c3ec

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
10.2 KB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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_cupertino_navigation_bar(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.CupertinoNavigationBar(
13+
bgcolor=ft.Colors.AMBER_100,
14+
inactive_color=ft.Colors.GREY,
15+
active_color=ft.Colors.BLACK,
16+
on_change=lambda e: print("Selected tab:", e.control.selected_index),
17+
destinations=[
18+
ft.NavigationBarDestination(
19+
icon=ft.Icons.EXPLORE_OUTLINED,
20+
selected_icon=ft.Icons.EXPLORE,
21+
label="Explore",
22+
),
23+
ft.NavigationBarDestination(
24+
icon=ft.Icons.COMMUTE_OUTLINED,
25+
selected_icon=ft.Icons.COMMUTE,
26+
label="Commute",
27+
),
28+
ft.NavigationBarDestination(
29+
icon=ft.Icons.BOOKMARK_BORDER,
30+
selected_icon=ft.Icons.BOOKMARK,
31+
label="Favorites",
32+
),
33+
],
34+
),
35+
)

0 commit comments

Comments
 (0)