test: remediate and stabilize auxiliary backend and frontend tests

- Standardized task log, LLM provider, and report profile tests.
- Relocated auxiliary tests into __tests__ directories for consistency.
- Updated git_service and defensive guards with minor stability fixes discovered during testing.
- Added UX integration tests for the reports list component.
This commit is contained in:
2026-03-04 13:54:06 +03:00
parent 0894254b98
commit f34f9c1b2e
8 changed files with 408 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import sys
from pathlib import Path
import shutil
import pytest
from unittest.mock import MagicMock
@@ -15,6 +16,17 @@ def test_git_service_get_repo_path_guard():
with pytest.raises(ValueError, match="dashboard_id cannot be None"):
service._get_repo_path(None)
def test_git_service_get_repo_path_recreates_base_dir():
"""Verify _get_repo_path recreates missing base directory before returning repo path."""
service = GitService(base_path="test_repos_runtime_recreate")
shutil.rmtree(service.base_path, ignore_errors=True)
repo_path = service._get_repo_path(42)
assert Path(service.base_path).is_dir()
assert repo_path == str(Path(service.base_path) / "42")
def test_superset_client_import_dashboard_guard():
"""Verify that import_dashboard raises ValueError if file_name is None."""
mock_env = Environment(