@@ -39421,23 +39421,6 @@ def test_video_embed_js_is_iife():
3942139421 assert content.rstrip().endswith("})();")
3942239422
3942339423
39424- def test_video_embed_js_has_youtube_enhancement():
39425- """video-embed.js contains YouTube thumbnail placeholder logic."""
39426-
39427- from great_docs.core import GreatDocs
39428-
39429- with tempfile.TemporaryDirectory() as tmp_dir:
39430- docs = GreatDocs(project_path=tmp_dir)
39431- content = (docs.assets_path / "video-embed.js").read_text(encoding="utf-8")
39432-
39433- assert "enhanceYouTube" in content
39434- assert "getYouTubeId" in content
39435- assert "gd-video-placeholder" in content
39436- assert "gd-video-thumb" in content
39437- assert "gd-video-play" in content
39438- assert "img.youtube.com" in content
39439-
39440-
3944139424def test_video_embed_js_has_lazy_loading():
3944239425 """video-embed.js contains IntersectionObserver lazy-loading for non-YouTube iframes."""
3944339426
@@ -39466,85 +39449,8 @@ def test_video_embed_js_has_video_element_enhancement():
3946639449 assert '"preload"' in content
3946739450
3946839451
39469- def test_video_embed_js_youtube_id_extraction():
39470- """video-embed.js can extract YouTube IDs from embed URLs."""
39471-
39472- from great_docs.core import GreatDocs
39473-
39474- with tempfile.TemporaryDirectory() as tmp_dir:
39475- docs = GreatDocs(project_path=tmp_dir)
39476- content = (docs.assets_path / "video-embed.js").read_text(encoding="utf-8")
39477-
39478- # The regex should match both youtube.com and youtube-nocookie.com
39479- assert "youtube.com" in content
39480- assert "youtube-nocookie.com" in content
39481-
39482-
39483- def test_video_embed_js_accessibility():
39484- """video-embed.js includes proper accessibility attributes."""
39485-
39486- from great_docs.core import GreatDocs
39487-
39488- with tempfile.TemporaryDirectory() as tmp_dir:
39489- docs = GreatDocs(project_path=tmp_dir)
39490- content = (docs.assets_path / "video-embed.js").read_text(encoding="utf-8")
39491-
39492- # Placeholder should have role="button" for screen readers
39493- assert '"button"' in content
39494-
39495- # Should support keyboard activation
39496- assert '"Enter"' in content
39497- assert '" "' in content # Space key
39498-
39499- # Should have aria-label
39500- assert "aria-label" in content
39501-
39502- # Should have tabindex for keyboard focus
39503- assert "tabindex" in content
39504-
39505-
39506- def test_video_embed_js_autoplay_on_click():
39507- """video-embed.js appends autoplay=1 when loading the player after click."""
39508-
39509- from great_docs.core import GreatDocs
39510-
39511- with tempfile.TemporaryDirectory() as tmp_dir:
39512- docs = GreatDocs(project_path=tmp_dir)
39513- content = (docs.assets_path / "video-embed.js").read_text(encoding="utf-8")
39514-
39515- assert "autoplay=1" in content
39516-
39517-
39518- def test_video_embed_js_thumbnail_fallback():
39519- """video-embed.js falls back from maxresdefault to hqdefault thumbnail."""
39520-
39521- from great_docs.core import GreatDocs
39522-
39523- with tempfile.TemporaryDirectory() as tmp_dir:
39524- docs = GreatDocs(project_path=tmp_dir)
39525- content = (docs.assets_path / "video-embed.js").read_text(encoding="utf-8")
39526-
39527- assert "maxresdefault" in content
39528- assert "hqdefault" in content
39529- assert "onerror" in content
39530-
39531-
39532- def test_video_embed_js_play_button_svg():
39533- """video-embed.js includes an inline SVG play button."""
39534-
39535- from great_docs.core import GreatDocs
39536-
39537- with tempfile.TemporaryDirectory() as tmp_dir:
39538- docs = GreatDocs(project_path=tmp_dir)
39539- content = (docs.assets_path / "video-embed.js").read_text(encoding="utf-8")
39540-
39541- assert "PLAY_SVG" in content
39542- assert "<svg" in content
39543- assert "gd-play-bg" in content
39544-
39545-
3954639452def test_scss_has_video_styles():
39547- """great-docs.scss contains styling for video containers and placeholders ."""
39453+ """great-docs.scss contains styling for video containers."""
3954839454
3954939455 from great_docs.core import GreatDocs
3955039456
@@ -39555,12 +39461,6 @@ def test_scss_has_video_styles():
3955539461 # Video container border
3955639462 assert ".quarto-video" in content
3955739463
39558- # Placeholder styles
39559- assert ".gd-video-placeholder" in content
39560- assert ".gd-video-thumb" in content
39561- assert ".gd-video-play" in content
39562- assert ".gd-play-bg" in content
39563-
3956439464
3956539465def test_scss_video_container_has_border():
3956639466 """The .quarto-video container has a border and border-radius."""
@@ -39593,20 +39493,6 @@ def test_scss_video_dark_mode():
3959339493 )
3959439494
3959539495
39596- def test_scss_video_placeholder_positioning():
39597- """The placeholder overlay is positioned absolutely to fill the container."""
39598-
39599- from great_docs.core import GreatDocs
39600-
39601- with tempfile.TemporaryDirectory() as tmp_dir:
39602- docs = GreatDocs(project_path=tmp_dir)
39603- content = (docs.assets_path / "great-docs.scss").read_text(encoding="utf-8")
39604-
39605- # The placeholder must cover the entire ratio container
39606- assert "position: absolute" in content
39607- assert "cursor: pointer" in content
39608-
39609-
3961039496def test_scss_video_focus_visible():
3961139497 """The placeholder has :focus-visible styling for keyboard accessibility."""
3961239498
0 commit comments