first commit

This commit is contained in:
Daniel Maas committed 2026-10-05 18:38:53 +02:00
commit 20d7fe39bd
6 files changed
+258

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import flet.testing as ftt
async def test_increment(flet_app: ftt.FletTestApp):
"""Counter sample: tap the FAB and assert the counter goes 0 -> 1.
The `flet_app` fixture is provided automatically by the flet pytest plugin.
Run with `flet test` (or `uv run pytest`) from the project directory.
"""
tester = flet_app.tester
await tester.pump_and_settle()
# Initial state
assert (await tester.find_by_text("0")).count == 1
# Tap the increment button (found by its key) and let the UI settle
await tester.tap(await tester.find_by_key("increment"))
await tester.pump_and_settle()
# New state
assert (await tester.find_by_text("1")).count == 1