diff --git a/src/files-and-videos/videos-page/transcript-settings/OrderTranscriptForm.jsx b/src/files-and-videos/videos-page/transcript-settings/OrderTranscriptForm.jsx index a55a0483b..085708ae4 100644 --- a/src/files-and-videos/videos-page/transcript-settings/OrderTranscriptForm.jsx +++ b/src/files-and-videos/videos-page/transcript-settings/OrderTranscriptForm.jsx @@ -25,6 +25,9 @@ const OrderTranscriptForm = ({ const [data, setData] = useState(activeTranscriptPreferences || { videoSourceLanguage: '' }); const [validCieloTranscriptionPlan, validThreePlayTranscriptionPlan] = checkTranscriptionPlans(transcriptionPlans); + useEffect(() => { + setTranscriptType(activeTranscriptPreferences?.provider || 'order'); + }, []); let [cieloHasCredentials, threePlayHasCredentials] = checkCredentials(transcriptCredentials); useEffect(() => { diff --git a/src/files-and-videos/videos-page/transcript-settings/TranscriptSettings.jsx b/src/files-and-videos/videos-page/transcript-settings/TranscriptSettings.jsx index 85ddf7b52..247cc5589 100644 --- a/src/files-and-videos/videos-page/transcript-settings/TranscriptSettings.jsx +++ b/src/files-and-videos/videos-page/transcript-settings/TranscriptSettings.jsx @@ -35,7 +35,7 @@ const TranscriptSettings = ({ isAiTranslationsEnabled, } = pageSettings; const { transcriptionPlans } = videoTranscriptSettings || {}; - const [transcriptType, setTranscriptType] = useState(activeTranscriptPreferences?.provider); + const [transcriptType, setTranscriptType] = useState(null); const [isAiTranslations, setIsAiTranslations] = useState(false); const handleOrderTranscripts = (data, provider) => { @@ -81,7 +81,7 @@ const TranscriptSettings = ({ - {transcriptType ? ( + { transcriptType ? (
{ }); it('should load page with Cielo24 selected', async () => { + const orderButton = screen.getByText(messages.orderTranscriptsTitle.defaultMessage); + await act(async () => { + userEvent.click(orderButton); + }); const cielo24Button = screen.getByText(messages.cieloLabel.defaultMessage); expect(within(cielo24Button).getByLabelText('Cielo24 radio')).toHaveProperty('checked', true); @@ -180,6 +184,10 @@ describe('TranscriptSettings', () => { axiosMock = new MockAdapter(getAuthenticatedHttpClient()); renderComponent(defaultProps); + const orderButton = screen.getByText(messages.orderTranscriptsTitle.defaultMessage); + await act(async () => { + userEvent.click(orderButton); + }); const noneButton = screen.getAllByLabelText('none radio')[0]; await act(async () => {