feat(ui): base.html, macros (badges, lightbox), shared.js, register_shared_ui

This commit is contained in:
2026-06-27 17:11:49 +02:00
parent 4db684fbdc
commit c36d93e3c7
5 changed files with 151 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import os
from flask import Flask, render_template
from photoflow.ui import TEMPLATE_DIR, STATIC_DIR, register_shared_ui
def test_dirs_exist():
assert os.path.isfile(os.path.join(TEMPLATE_DIR, "base.html"))
assert os.path.isfile(os.path.join(STATIC_DIR, "shared.js"))
def test_register_serves_shared_static_and_template():
app = Flask(__name__)
register_shared_ui(app)
@app.route("/page")
def page():
return render_template("base.html")
client = app.test_client()
r = client.get("/page")
assert r.status_code == 200
assert b"/shared-static/shared.js" in r.data
js = client.get("/shared-static/shared.js")
assert js.status_code == 200 and b"photoGrid" in js.data