Initial upload: DevDash CLI with TUI dashboard
Some checks failed
CI / test (push) Failing after 17s
Some checks failed
CI / test (push) Failing after 17s
This commit is contained in:
49
tests/test_ui/test_dashboard.py
Normal file
49
tests/test_ui/test_dashboard.py
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user