diff --git a/tests/test_unit/test_napari_widgets.py b/tests/test_unit/test_napari_widgets.py index ad4f7be3..27bf8eb4 100644 --- a/tests/test_unit/test_napari_widgets.py +++ b/tests/test_unit/test_napari_widgets.py @@ -1,4 +1,5 @@ import pytest +from qtpy.QtWidgets import QWidget from movement.napari.meta_widget import MovementMetaWidget @@ -11,3 +12,31 @@ def meta_widget(make_napari_viewer) -> MovementMetaWidget: can be instantiated without crashing.""" viewer = make_napari_viewer() return MovementMetaWidget(viewer) + + +@pytest.fixture +def loader_widget(meta_widget) -> QWidget: + """Fixture to expose the Loader widget for testing.""" + # content() gets the QWidget inside the CollapsibleWidget + loader = meta_widget.loader.content() + return loader + + +def test_meta_widget(meta_widget): + """Test that the meta widget is properly instantiated.""" + assert meta_widget is not None + assert len(meta_widget.collapsible_widgets) >= 1 + + first_widget = meta_widget.collapsible_widgets[0] + assert first_widget._text == "Load" + assert first_widget.isExpanded() + + +def test_loader_widget(loader_widget): + """Test that the loader widget is properly instantiated.""" + assert loader_widget is not None + # Default values + assert loader_widget.source_software_combo.currentText() == "SLEAP" + assert loader_widget.fps_spinbox.value() == 50 + assert loader_widget.file_path_edit.text() == "" + assert loader_widget.load_button.text() == "Load"