feat(chat): share a chat by link — anonymous read-only /shared/<token> page, share/unshare
This commit is contained in:
@@ -29,6 +29,7 @@ HTML_PAGES = (
|
||||
"login.html",
|
||||
"git-sources.html",
|
||||
"history.html", # phase 50: the admin saved-chats page
|
||||
"shared.html", # phase 51: the anonymous shared-conversation page
|
||||
)
|
||||
|
||||
|
||||
@@ -138,9 +139,13 @@ def test_every_page_loads_brand_js_before_its_module_script() -> None:
|
||||
default must be set first)."""
|
||||
for page in HTML_PAGES:
|
||||
html = _text(FRONTEND / page)
|
||||
brand_idx = html.find('<script src="assets/brand.js"></script>')
|
||||
# Optional leading slash: root-level pages use "assets/brand.js",
|
||||
# but the shared page is served from the NESTED /shared/<token>
|
||||
# route, where a relative ref would 404 — it uses "/assets/…".
|
||||
m = re.search(r'<script src="(?:/)?assets/brand\.js"></script>', html)
|
||||
assert m, f"{page}: brand.js must load"
|
||||
brand_idx = m.start()
|
||||
module_idx = html.find('<script type="module"')
|
||||
assert brand_idx != -1, f"{page}: brand.js must load"
|
||||
assert module_idx != -1, f"{page}: the page module must load"
|
||||
assert brand_idx < module_idx, (
|
||||
f"{page}: brand.js must load BEFORE the module script"
|
||||
|
||||
Reference in New Issue
Block a user