test: split modal import ui contract
This commit is contained in:
parent
ff9f64675c
commit
f7554b889a
@ -2,7 +2,7 @@ from zotero_kb.api import create_app
|
||||
from zotero_kb.config import AppConfig
|
||||
|
||||
|
||||
def test_index_contains_import_modal_controls(tmp_path) -> None:
|
||||
def _get_index_html(tmp_path) -> str:
|
||||
app = create_app(
|
||||
AppConfig(
|
||||
workspace_dir=tmp_path / "workspace",
|
||||
@ -13,12 +13,22 @@ def test_index_contains_import_modal_controls(tmp_path) -> None:
|
||||
|
||||
for route in app.routes:
|
||||
if getattr(route, "path", None) == "/" and "GET" in getattr(route, "methods", set()):
|
||||
html = route.endpoint()
|
||||
break
|
||||
else:
|
||||
raise AssertionError("GET / route not found")
|
||||
return route.endpoint()
|
||||
|
||||
raise AssertionError("GET / route not found")
|
||||
|
||||
|
||||
def test_index_contains_base_page_forms(tmp_path) -> None:
|
||||
html = _get_index_html(tmp_path)
|
||||
|
||||
assert 'id="create-project-form"' in html
|
||||
assert 'id="recommend-form"' in html
|
||||
assert 'id="plan-form"' in html
|
||||
|
||||
|
||||
def test_index_contains_import_modal_controls(tmp_path) -> None:
|
||||
html = _get_index_html(tmp_path)
|
||||
|
||||
assert 'id="open-import-modal-button"' in html
|
||||
assert 'id="import-modal"' in html
|
||||
assert 'id="close-import-modal-button"' in html
|
||||
@ -31,5 +41,3 @@ def test_index_contains_import_modal_controls(tmp_path) -> None:
|
||||
assert 'id="item-preview-popover"' in html
|
||||
assert 'const ABSTRACT_PREVIEW_DELAY_MS = 3000;' in html
|
||||
assert 'isImportModalOpen: false' in html
|
||||
assert 'id="recommend-form"' in html
|
||||
assert 'id="plan-form"' in html
|
||||
|
||||
Loading…
Reference in New Issue
Block a user