@@ -101,6 +101,16 @@ describe( 'video_present rule', () => {
101101 html : '<video><source src="movie.MP4"></video>' ,
102102 shouldPass : false ,
103103 } ,
104+ {
105+ name : 'detects .ogg file used as a native <video> element src' ,
106+ html : '<video src="movie.ogg" controls></video>' ,
107+ shouldPass : false ,
108+ } ,
109+ {
110+ name : 'detects .ogg source that is not inside an <audio> element' ,
111+ html : '<source src="clip.ogg">' ,
112+ shouldPass : false ,
113+ } ,
104114
105115 // Should not trigger violations
106116 {
@@ -135,6 +145,26 @@ describe( 'video_present rule', () => {
135145 html : '<audio controls><source src="sound.mp3" type="audio/mpeg"></audio>' ,
136146 shouldPass : true ,
137147 } ,
148+ {
149+ // Direct/minimal case: the <audio> element itself has a .ogg src, exercising the
150+ // `tag === 'audio'` path in is-video-detected.js without any wrapping markup.
151+ name : 'does not detect a plain <audio> element with a .ogg src' ,
152+ html : '<audio controls src="simple-guitar-melody.ogg"></audio>' ,
153+ shouldPass : true ,
154+ } ,
155+ {
156+ // Regression test for https://github.com/equalizedigital/accessibility-checker/issues/1816 (PRO-1168).
157+ // The Gutenberg Audio block's default sample audio is an .ogg (Ogg Vorbis) file, which was
158+ // being misidentified as video content because .ogg is also a valid Ogg Theora video extension.
159+ name : 'does not detect .ogg audio file in a <figure class="wp-block-audio"> Audio block' ,
160+ html : '<figure class="wp-block-audio"><audio controls src="simple-guitar-melody.ogg"></audio><figcaption>Simple Guitar Melody</figcaption></figure>' ,
161+ shouldPass : true ,
162+ } ,
163+ {
164+ name : 'does not detect .ogg source element inside an <audio> element' ,
165+ html : '<audio controls><source src="simple-guitar-melody.ogg" type="audio/ogg"></audio>' ,
166+ shouldPass : true ,
167+ } ,
138168 {
139169 name : 'does not detect YouTube API script tag' ,
140170 html : '<script type="text/javascript" src="https://www.youtube.com/iframe_api?ver=1.2.6" id="youtube-scripts-js"></script>' ,
0 commit comments