@@ -21,15 +21,27 @@ describe('Media', function () {
21
21
} ;
22
22
23
23
if ( mediaComponent . _transcript ) {
24
- cy . get ( '.media__transcript-body-inline' ) . should ( 'not.be.visible' ) ;
25
- cy . get ( 'button.media__transcript-btn' ) . should ( 'contain' , mediaComponent . _transcript . inlineTranscriptButton ) . click ( ) ;
26
- cy . get ( '.media__transcript-body-inline-inner' ) . should ( 'be.visible' ) . should ( 'contain' , mediaComponent . _transcript . inlineTranscriptBody ) ;
27
- cy . get ( 'button.media__transcript-btn' ) . should ( 'contain' , mediaComponent . _transcript . inlineTranscriptCloseButton ) . click ( ) ;
28
- cy . get ( '.media__transcript-body-inline' ) . should ( 'not.be.visible' ) ;
24
+ if ( mediaComponent . _transcript . _inlineTranscript ) {
25
+ cy . get ( '.media__transcript-body-inline' ) . should ( 'not.be.visible' ) ;
26
+ cy . get ( 'button.media__transcript-btn-inline' ) . should ( 'be.visible' ) ;
27
+ cy . get ( 'button.media__transcript-btn-inline' ) . should ( 'contain' , mediaComponent . _transcript . inlineTranscriptButton ) . click ( ) ;
28
+ cy . get ( '.media__transcript-body-inline-inner' ) . should ( 'be.visible' ) . should ( 'contain' , mediaComponent . _transcript . inlineTranscriptBody ) ;
29
+ cy . get ( 'button.media__transcript-btn-inline' ) . should ( 'contain' , mediaComponent . _transcript . inlineTranscriptCloseButton ) . click ( ) ;
30
+ cy . get ( '.media__transcript-body-inline' ) . should ( 'not.be.visible' ) ;
31
+ } else {
32
+ cy . get ( 'button.media__transcript-btn-inline' ) . should ( 'not.be.visible' ) ;
33
+ }
34
+
35
+ if ( mediaComponent . _transcript . _externalTranscript ) {
36
+ cy . get ( 'button.media__transcript-btn-external' ) . should ( 'be.visible' )
37
+ cy . get ( 'button.media__transcript-btn-external' ) . should ( 'contain' , mediaComponent . _transcript . transcriptLinkButton ) ;
38
+ } else {
39
+ cy . get ( 'button.media__transcript-btn-external' ) . should ( 'not.be.visible' )
40
+ }
29
41
} ;
30
42
31
43
// Allow the component to load and run external custom tests
32
44
cy . wait ( 1000 ) ;
33
45
} ) ;
34
46
} ) ;
35
- } ) ;
47
+ } ) ;
0 commit comments