36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
import pytest
|
|
|
|
from src.views import dashboard
|
|
|
|
|
|
@pytest.mark.anyio
|
|
async def test_dashboard_renders_outside_repository_working_directory(monkeypatch, tmp_path):
|
|
monkeypatch.chdir(tmp_path)
|
|
|
|
html = await dashboard()
|
|
|
|
assert "Stackchain Dashboard" in html
|
|
|
|
|
|
@pytest.mark.anyio
|
|
async def test_dashboard_viewport_allows_mobile_zoom():
|
|
html = await dashboard()
|
|
|
|
assert 'name="viewport"' in html
|
|
assert "width=device-width" in html
|
|
assert "user-scalable=no" not in html
|
|
|
|
|
|
@pytest.mark.anyio
|
|
async def test_global_search_preview_is_a_phone_safe_accessible_dialog():
|
|
html = await dashboard()
|
|
|
|
assert 'id="search-preview" role="dialog" aria-modal="true"' in html
|
|
assert 'aria-labelledby="search-preview-title"' in html
|
|
assert 'id="claim-search-result"' in html
|
|
assert 'id="open-search-result-gitea"' in html
|
|
assert 'src="static/search-preview.js"' in html
|
|
assert ".search-preview-panel" in html
|
|
assert "height:100dvh" in html
|
|
assert "env(safe-area-inset-bottom)" in html
|