Skip to content

Commit

Permalink
TST: Added unit test checking dropdown positions in gui
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilo9999 authored and gtdang committed Jul 25, 2024
1 parent a81d8fc commit 72eb0df
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hnn_core/gui/_viz_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def reset_fig_config_tabs(self, template_name=None):
simulation_data_selection = ax_control.children[1]
simulation_data_selection.options = simulation_names

# Update the options for the simulation to compare dropdown
# Update the options for the data to compare dropdown
simulation_to_compare = ax_control.children[4]
simulation_to_compare.options = simulation_names

Expand Down
35 changes: 35 additions & 0 deletions hnn_core/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,3 +741,38 @@ def test_gui_cell_params_widgets(setup_gui):
assert (len(cell_params['Synapses']) == 12)
assert (len(cell_params['Biophysics L2']) == 10)
assert (len(cell_params['Biophysics L5']) == 20)


def test_fig_tabs_dropdown_lists(setup_gui):
"""Test the GUI download simulation pipeline."""

gui = setup_gui

gui.widget_ntrials.value = 1

# Initiate 1rs simulation
sim_name = "sim1"
gui.widget_simulation_name.value = sim_name

# Run simulation
gui.run_button.click()

# Initiate 2nd simulation
sim_name2 = "sim2"
gui.widget_simulation_name.value = sim_name2

# Run simulation
gui.run_button.click()

viz_tabs = gui.viz_manager.axes_config_tabs.children
for tab in viz_tabs:
controls = tab.children[1]
for ax_control in controls.children:
assert ax_control.children[1].description == "Simulation Data:"
sim_names = ax_control.children[1].options
assert all(sim in sim_names for sim in [sim_name, sim_name2])

assert ax_control.children[4].description == "Data to Compare:"

if ax_control.children[0].value != "input histogram":
assert not ax_control.children[4].disabled

0 comments on commit 72eb0df

Please sign in to comment.