Fix test_refresh_preserves_state not waiting for collapse

history_panel_click_item_title was called with wait=False when
collapsing dataset details. This returned immediately after clicking,
without waiting for the GCollapse animation to complete or the
ExpandedItems store to persist the collapsed state to sessionStorage.
The subsequent navigation (self.home()) could then race ahead of the
state persistence, causing the item to appear expanded after refresh.

Fix: use wait=True so the click waits for
details_component.wait_for_absent_or_hidden(), matching the pattern
already used for expanding in the same test.
This commit is contained in:
mvdbeek
2026-03-30 15:08:29 +02:00
parent e86b306acb
commit 0528097806
@@ -156,7 +156,6 @@ class TestHistoryPanel(SeleniumTestCase):
close_btn.click()
self.sleep_for(self.wait_types.UX_RENDER)
@selenium_only("Not yet migrated to support Playwright backend")
@selenium_test
def test_refresh_preserves_state(self):
self.perform_upload(self.get_filename("1.txt"))
@@ -175,7 +174,7 @@ class TestHistoryPanel(SeleniumTestCase):
assert self.history_panel_item_showing_details(hid=1)
# Close the detailed display, refresh, and ensure they are still closed.
self.history_panel_click_item_title(hid=1, wait=False)
self.history_panel_click_item_title(hid=1, wait=True)
assert not self.history_panel_item_showing_details(hid=1)
self._refresh()