Skip to content

Commit f736d4d

Browse files
committed
Add tests.
1 parent 09f2906 commit f736d4d

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

tests/tests_tui/test_tui_datatypes.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,47 @@ async def test_select_displayed_datatypes_transfer(
213213
assert kwargs["datatype"] == ["ecephys", "fusi"]
214214
assert kwargs["overwrite_existing_files"] == "never"
215215
assert kwargs["dry_run"] is False
216+
217+
@pytest.mark.asyncio
218+
async def test_transfer_displayed_datatypes_widgets_hide_after_mode_switch(
219+
self, setup_project_paths
220+
):
221+
"""Test that after editing the displayed datatypes in custom transfer, the
222+
widgets are properly hidden. This test was added after a bug in which the
223+
old, deleted widgets were still persistent on the other tabs.
224+
"""
225+
tmp_config_path, tmp_path, project_name = setup_project_paths.values()
226+
227+
app = TuiApp()
228+
async with app.run_test(size=self.tui_size()) as pilot:
229+
await self.check_and_click_onto_existing_project(
230+
pilot, project_name
231+
)
232+
233+
await self.switch_tab(pilot, "transfer")
234+
await self.scroll_to_click_pause(
235+
pilot, "#transfer_custom_radiobutton"
236+
)
237+
await self.scroll_to_click_pause(
238+
pilot,
239+
"#transfer_tab_displayed_datatypes_button",
240+
)
241+
await self.scroll_to_click_pause(
242+
pilot, "#displayed_datatypes_close_button"
243+
)
244+
await self.scroll_to_click_pause(
245+
pilot, "#transfer_toplevel_radiobutton"
246+
)
247+
248+
assert (
249+
pilot.app.screen.query_one(
250+
"#transfer_custom_datatype_checkboxes"
251+
).display
252+
is False
253+
)
254+
assert (
255+
pilot.app.screen.query_one(
256+
"#transfer_tab_displayed_datatypes_button"
257+
).display
258+
is False
259+
)

0 commit comments

Comments
 (0)