4ad335ca84
Replace full-page soft nav with a persistent shell and /api/embed/page loads so tab switches in the hub iframe avoid document.write flicker. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
730 B
Python
27 lines
730 B
Python
from instance_embed_lib import (
|
|
EMBED_TABS,
|
|
path_to_embed_tab,
|
|
rewrite_embed_dest,
|
|
)
|
|
|
|
|
|
def test_path_to_embed_tab():
|
|
assert path_to_embed_tab("/trade") == "trade"
|
|
assert path_to_embed_tab("/key_monitor") == "key_monitor"
|
|
assert path_to_embed_tab("/strategy/records") == "strategy_records"
|
|
assert path_to_embed_tab("/unknown") is None
|
|
|
|
|
|
def test_rewrite_embed_dest():
|
|
url = rewrite_embed_dest("/trade", hub_theme="dark")
|
|
assert url.startswith("/embed?")
|
|
assert "tab=trade" in url
|
|
assert "embed=1" in url
|
|
assert "hub_theme=dark" in url
|
|
|
|
|
|
def test_embed_tabs_cover_main_nav():
|
|
assert "trade" in EMBED_TABS
|
|
assert "key_monitor" in EMBED_TABS
|
|
assert "records" in EMBED_TABS
|