@@ -590,6 +590,29 @@ describe("audio_group_no_members", () => {
590590 expect ( finding ?. message ) . toContain ( "voiceovr" ) ;
591591 } ) ;
592592
593+ it ( "suggests only unmatched member ids, not a healthy sibling group" , async ( ) => {
594+ const res = await lintHyperframeHtml (
595+ doc ( `${ BUS } <hf-audio-group id="music"></hf-audio-group>
596+ <audio id="bgm" src="music.wav" data-start="0" data-duration="5" data-audio-group="music"></audio>
597+ <audio id="vo-1" src="vo.wav" data-start="0" data-duration="5" data-audio-group="voiceovr"></audio>` ) ,
598+ ) ;
599+ const finding = res . findings . find ( ( item ) => item . code === "audio_group_no_members" ) ;
600+ expect ( finding ?. message ) . toContain ( '"voiceovr"' ) ;
601+ expect ( finding ?. message ) . not . toContain ( '"music"' ) ;
602+ } ) ;
603+
604+ it ( "does not count video as group membership" , async ( ) => {
605+ const res = await lintHyperframeHtml (
606+ doc ( `${ BUS } <video id="v" src="v.mp4" data-start="0" data-duration="5" data-audio-group="voiceover"></video>
607+ <audio id="s-1" src="s.wav" data-start="0" data-duration="2" data-audio-group="sfx"></audio>` ) ,
608+ ) ;
609+ expect (
610+ res . findings . some (
611+ ( finding ) => finding . code === "audio_group_no_members" && finding . elementId === "voiceover" ,
612+ ) ,
613+ ) . toBe ( true ) ;
614+ } ) ;
615+
593616 it ( "stays quiet when a clip belongs to it" , async ( ) => {
594617 const res = await lintHyperframeHtml (
595618 doc (
@@ -607,11 +630,7 @@ describe("audio_group_no_members", () => {
607630 // file (timelineAudioGroupCreate) — so a file holding a bus and no members at
608631 // all is the normal cross-file shape, not a mistake.
609632 it ( "stays quiet in a file that declares no members at all" , async ( ) => {
610- const res = await lintHyperframeHtml (
611- doc (
612- `${ BUS } <div id="host" data-composition-src="compositions/voices.html" data-start="0" data-duration="10"></div>` ,
613- ) ,
614- ) ;
633+ const res = await lintHyperframeHtml ( doc ( BUS ) ) ;
615634 expect ( res . findings . some ( ( f ) => f . code === "audio_group_no_members" ) ) . toBe ( false ) ;
616635 } ) ;
617636
@@ -627,7 +646,8 @@ describe("audio_group_no_members", () => {
627646
628647 it ( "stays quiet for a bus with no id" , async ( ) => {
629648 const res = await lintHyperframeHtml (
630- doc ( `<hf-audio-group data-label="Nameless"></hf-audio-group>` ) ,
649+ doc ( `<hf-audio-group data-label="Nameless"></hf-audio-group>
650+ <audio id="s-1" src="s.wav" data-start="0" data-duration="2" data-audio-group="sfx"></audio>` ) ,
631651 ) ;
632652 expect ( res . findings . some ( ( f ) => f . code === "audio_group_no_members" ) ) . toBe ( false ) ;
633653 } ) ;
0 commit comments