diff --git a/xmodule/js/spec/video/video_caption_spec.js b/xmodule/js/spec/video/video_caption_spec.js index ff6749b11c..43b2bfcb3c 100644 --- a/xmodule/js/spec/video/video_caption_spec.js +++ b/xmodule/js/spec/video/video_caption_spec.js @@ -637,7 +637,7 @@ spyOn(Caption, 'renderCaption'); spyOn(Caption, 'bindHandlers'); spyOn(Caption, 'updatePlayTime'); - spyOn(Caption, 'renderGoogleDisclaimer'); + spyOn(Caption, 'updateGoogleDisclaimer'); spyOn(Caption, 'hideCaptions'); spyOn(state, 'youtubeId').and.returnValue('Z5KLxerq05Y'); }); @@ -716,7 +716,7 @@ expect($.ajaxWithPrefix).toHaveBeenCalled(); expect(Caption.bindHandlers).toHaveBeenCalled(); expect(Caption.renderCaption).toHaveBeenCalled(); - expect(Caption.renderGoogleDisclaimer).toHaveBeenCalled() + expect(Caption.updateGoogleDisclaimer).toHaveBeenCalled() expect(Caption.updatePlayTime).not.toHaveBeenCalled(); expect(Caption.loaded).toBeTruthy(); }); @@ -1355,22 +1355,22 @@ }) it('not shown when captions are not ai generated', () => { - Caption.renderGoogleDisclaimer(BASE_CAPTIONS) + Caption.updateGoogleDisclaimer(BASE_CAPTIONS) expect(state.shouldShowGoogleDisclaimer).toBe(false); }); it('not shown when captions are not generated by gcp', () => { - Caption.renderGoogleDisclaimer(makeCaptions('someoneElse')) + Caption.updateGoogleDisclaimer(makeCaptions('someoneElse')) expect(state.shouldShowGoogleDisclaimer).toBe(false); }); it('shown when captions are generated by gcp', () => { - Caption.renderGoogleDisclaimer(makeCaptions('gcp')) + Caption.updateGoogleDisclaimer(makeCaptions('gcp')) expect(state.shouldShowGoogleDisclaimer).toBe(true); }); it('shown when captions have no provider', () => { - Caption.renderGoogleDisclaimer(makeCaptions()) + Caption.updateGoogleDisclaimer(makeCaptions()) expect(state.shouldShowGoogleDisclaimer).toBe(true); }); }); diff --git a/xmodule/js/src/video/09_video_caption.js b/xmodule/js/src/video/09_video_caption.js index 6d8ff00332..fee10d7679 100644 --- a/xmodule/js/src/video/09_video_caption.js +++ b/xmodule/js/src/video/09_video_caption.js @@ -507,7 +507,7 @@ var self = this, state = this.state, aiGeneratedSpan = captions.find(caption => caption.includes(aIGeneratedSpanText)), - captionsAIGenerated = !(aiGeneratedSpan === undefined); + captionsAIGenerated = !(aiGeneratedSpan === undefined), aiCaptionProviderIsGoogle = true; if (captionsAIGenerated) { @@ -614,7 +614,7 @@ captions = self.updateProblematicCaptionsContent(captions, contentToReplace, replacementContent); - self.renderGoogleDisclaimer(captions); + self.updateGoogleDisclaimer(captions); if (self.loaded) { if (self.rendered) {