diff --git a/tests/test_ui/test_dashboard.py b/tests/test_ui/test_dashboard.py new file mode 100644 index 0000000..f6b07ce --- /dev/null +++ b/tests/test_ui/test_dashboard.py @@ -0,0 +1,49 @@ +import pytest +from textual.app import App +from src.ui.screens.dashboard import DashboardScreen +from src.ui.components.status import StatusIndicator, StatusType +from src.ui.components.panels import GitStatusPanel +from src.git.status import GitStatus + + +class TestDashboardScreen: + def test_dashboard_screen_exists(self): + screen = DashboardScreen() + assert screen is not None + + +class TestStatusIndicator: + def test_status_indicator_success(self): + indicator = StatusIndicator(status=StatusType.SUCCESS) + assert indicator.status == StatusType.SUCCESS + + def test_status_indicator_failure(self): + indicator = StatusIndicator(status=StatusType.FAILURE) + assert indicator.status == StatusType.FAILURE + + def test_status_indicator_pending(self): + indicator = StatusIndicator(status=StatusType.PENDING) + assert indicator.status == StatusType.PENDING + + def test_status_indicator_running(self): + indicator = StatusIndicator(status=StatusType.RUNNING) + assert indicator.status == StatusType.RUNNING + + +class TestGitStatusPanel: + def test_git_status_panel_creation(self): + panel = GitStatusPanel() + assert panel is not None + + def test_git_status_panel_update(self): + panel = GitStatusPanel() + status = GitStatus( + branch="main", + commit="abc123def", + staged=1, + unstaged=2, + untracked=3, + is_clean=False, + ) + panel.update_status(status) + assert panel is not None