Skip to content

Commit f1b4fd3

Browse files
committed
fix: use distinct text in SnackBar to avoid duplicate match in integration test
The SnackBar and result_text both contained "Result: Flow completed!", causing find_by_text to match 2 elements instead of 1 in the CI integration test.
1 parent a605715 commit f1b4fd3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sdk/python/examples/apps/routing_navigation/pop_views_until.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def route_change():
9292

9393
def on_pop_result(e: ft.ViewsPopUntilEvent):
9494
result_text.value = f"Result: {e.result}"
95-
page.show_dialog(ft.SnackBar(ft.Text(f"Result: {e.result}")))
95+
page.show_dialog(ft.SnackBar(ft.Text(f"Got result: {e.result}")))
9696
page.update()
9797

9898
async def view_pop(e: ft.ViewPopEvent):

sdk/python/packages/flet/integration_tests/examples/apps/test_routing_navigation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,9 @@ async def test_pop_views_until(flet_app_function: ftt.FletTestApp):
236236
await flet_app_function.tester.pump_and_settle()
237237

238238
# Verify back at Home with result
239-
result_text = await flet_app_function.tester.find_by_text(
240-
"Result: Flow completed!"
241-
)
239+
result_text = await flet_app_function.tester.find_by_text("Result: Flow completed!")
242240
assert result_text.count == 1
243241

244242
# Verify we can start the flow again
245243
button = await flet_app_function.tester.find_by_text_containing("Start flow")
246-
assert button.count == 1
244+
assert button.count == 1

0 commit comments

Comments
 (0)