From 8a9dfdf8e32768d629b92b1fd547a8554040bf2d Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 21 Dec 2023 13:22:15 -0500 Subject: [PATCH] test coverage --- CHANGES.rst | 2 +- jdaviz/tests/test_user_api.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index e7fcb16f05..b70a9ac59c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -31,7 +31,7 @@ API Changes - ``width`` argument in Line Analysis plugin is renamed to ``continuum_width`` and ``width`` will be removed in a future release. [#2587] -- New API access to ``viz.data_labels``, ``viewer.data_labels_visible`` and +- New API access to ``viz.data_labels``, ``viewer.data_labels_visible``, and ``viewer.data_labels_loaded``. [#2626] Cubeviz diff --git a/jdaviz/tests/test_user_api.py b/jdaviz/tests/test_user_api.py index e18ba9c0a1..136c58db53 100644 --- a/jdaviz/tests/test_user_api.py +++ b/jdaviz/tests/test_user_api.py @@ -21,3 +21,12 @@ def test_specviz_zoom_level(specviz_helper): assert v._obj.state.x_max == 2 assert v._obj.state.y_min == 1 assert v._obj.state.y_max == 2 + + +def test_specviz_data_labels(specviz_helper, spectrum1d): + label = "Test 1D Spectrum" + specviz_helper.load_data(spectrum1d, data_label=label) + + assert specviz_helper.data_labels == [label] + assert specviz_helper.viewers['spectrum-viewer'].data_labels_loaded == [label] + assert specviz_helper.viewers['spectrum-viewer'].data_labels_visible == [label]