Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haticekaratay committed Dec 17, 2024
1 parent 73aad20 commit d19de55
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions jdaviz/configs/imviz/tests/test_catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_plugin_image_with_result(self, imviz_helper, tmp_path):
prev_results = catalogs_plugin.number_of_results

# testing that every variable updates accordingly when markers are cleared
catalogs_plugin.vue_do_clear()
catalogs_plugin.vue_do_clear_table()

assert not catalogs_plugin.results_available

Expand Down Expand Up @@ -237,20 +237,27 @@ def test_offline_ecsv_catalog(imviz_helper, image_2d_wcs, tmp_path):
assert catalogs_plugin.number_of_results == n_entries
assert len(imviz_helper.app.data_collection) == 2 # image + markers

catalogs_plugin.clear()
catalogs_plugin.clear_table()

assert not catalogs_plugin.results_available
assert len(imviz_helper.app.data_collection) == 2 # markers still there, just hidden

catalogs_plugin.clear(hide_only=False)
catalogs_plugin.clear_table(hide_only=False)
assert not catalogs_plugin.results_available
assert len(imviz_helper.app.data_collection) == 1 # markers gone for good

assert imviz_helper.viewers['imviz-0']._obj.state.x_min == -0.5
assert imviz_helper.viewers['imviz-0']._obj.state.x_max == 9.5
assert imviz_helper.viewers['imviz-0']._obj.state.y_min == -0.5
assert imviz_helper.viewers['imviz-0']._obj.state.y_max == 9.5
# Re-populate the table with a new search
out_tbl = catalogs_plugin.search()
assert len(out_tbl) > 0
# Ensure at least one row is selected before zooming
catalogs_plugin.table.selected_rows = [catalogs_plugin.table.items[0]]
assert len(catalogs_plugin.table.selected_rows) > 0

# Now zoom in
catalogs_plugin.vue_zoom_in()

assert imviz_helper.viewers['imviz-0']._obj.state.x_min == -49.99966
Expand Down

0 comments on commit d19de55

Please sign in to comment.