feat(dashboard): add administrator authentication

This commit is contained in:
2026-09-25 14:40:19 +00:00
parent 069d4c16fd
commit 7c2a6bdcd3
12 changed files with 1309 additions and 1 deletions
+7
View File
@@ -6,6 +6,7 @@ from streamlit.testing.v1 import AppTest
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from dashboard.app import get_transfer_review_items
from dashboard.authentication import ADMIN_ID_ENV, ADMIN_PASSWORD_ENV
from scripts.ci_fixture_db import create_ci_fixture_db
@@ -43,6 +44,8 @@ def test_streamlit_apptest_core_pages_use_synthetic_fixture_db(tmp_path, monkeyp
fixture = tmp_path / "fixture.sqlite3"
create_ci_fixture_db(fixture)
monkeypatch.setenv("JARCA_LEDGER_DB_PATH", str(fixture))
monkeypatch.setenv(ADMIN_ID_ENV, "test-admin")
monkeypatch.setenv(ADMIN_PASSWORD_ENV, "test-password")
app_path = Path(__file__).resolve().parents[1] / "dashboard" / "app.py"
page_expectations = {
@@ -58,6 +61,10 @@ def test_streamlit_apptest_core_pages_use_synthetic_fixture_db(tmp_path, monkeyp
if page == "월정산":
at.query_params["month"] = "2026-06"
at.run()
at.text_input[0].input("test-admin")
at.text_input[1].input("test-password")
next(button for button in at.button if button.label == "로그인").click()
at.run()
assert not at.exception
body_text = "\n".join(str(item.value) for item in list(at.text) + list(at.markdown) + list(at.caption))
assert expected_text in body_text