@@ -218,6 +218,10 @@ async def test_filter_by_category() -> None:
218218 app = CCFDeadlinesApp ()
219219
220220 async with app .run_test () as pilot :
221+ # Wait for initial load to complete and stop any pending loads
222+ await pilot .pause ()
223+ pilot .app ._is_loading = True # Block any further loading
224+
221225 # Set up initial data
222226 test_rows = create_mock_conference_rows ()
223227 pilot .app ._all_rows = test_rows
@@ -259,6 +263,10 @@ async def test_filter_by_rank() -> None:
259263 app = CCFDeadlinesApp ()
260264
261265 async with app .run_test () as pilot :
266+ # Wait for initial load to complete and stop any pending loads
267+ await pilot .pause ()
268+ pilot .app ._is_loading = True # Block any further loading
269+
262270 # Set up initial data
263271 test_rows = create_mock_conference_rows ()
264272 pilot .app ._all_rows = test_rows
@@ -298,6 +306,10 @@ async def test_search_filter() -> None:
298306 app = CCFDeadlinesApp ()
299307
300308 async with app .run_test () as pilot :
309+ # Wait for initial load to complete and stop any pending loads
310+ await pilot .pause ()
311+ pilot .app ._is_loading = True # Block any further loading
312+
301313 # Set up initial data
302314 test_rows = create_mock_conference_rows ()
303315 pilot .app ._all_rows = test_rows
@@ -397,6 +409,10 @@ async def test_keyboard_navigation() -> None:
397409 app = CCFDeadlinesApp ()
398410
399411 async with app .run_test () as pilot :
412+ # Wait for initial load to complete and stop any pending loads
413+ await pilot .pause ()
414+ pilot .app ._is_loading = True # Block any further loading
415+
400416 # Set up data
401417 test_rows = create_mock_conference_rows ()
402418 pilot .app ._all_rows = test_rows
@@ -438,6 +454,10 @@ async def test_open_url(mock_browser_open) -> None:
438454 app = CCFDeadlinesApp ()
439455
440456 async with app .run_test () as pilot :
457+ # Wait for initial load to complete and stop any pending loads
458+ await pilot .pause ()
459+ pilot .app ._is_loading = True # Block any further loading
460+
441461 # Set up data
442462 test_rows = create_mock_conference_rows ()
443463 pilot .app ._all_rows = test_rows
@@ -592,6 +612,10 @@ async def test_go_top_bottom_navigation() -> None:
592612 app = CCFDeadlinesApp ()
593613
594614 async with app .run_test () as pilot :
615+ # Wait for initial load to complete and stop any pending loads
616+ await pilot .pause ()
617+ pilot .app ._is_loading = True # Block any further loading
618+
595619 # Set up data with many rows
596620 now = datetime .now (timezone .utc )
597621 rows = [
@@ -648,6 +672,10 @@ async def test_multiple_filters_combined() -> None:
648672 app = CCFDeadlinesApp ()
649673
650674 async with app .run_test () as pilot :
675+ # Wait for initial load to complete and stop any pending loads
676+ await pilot .pause ()
677+ pilot .app ._is_loading = True # Block any further loading
678+
651679 # Set up data
652680 test_rows = create_mock_conference_rows ()
653681 pilot .app ._all_rows = test_rows
0 commit comments