Files
devdash-cli/tests/test_ui/test_dashboard.py
7000pctAUTO 56d12229eb
Some checks failed
CI / test (push) Failing after 17s
Initial upload: DevDash CLI with TUI dashboard
2026-02-01 06:53:11 +00:00

50 lines
1.5 KiB
Python

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