diff --git a/src/components/VoiceSearch/__tests__/VoiceSearch-test.tsx b/src/components/VoiceSearch/__tests__/VoiceSearch-test.tsx index d381ccb71d..583a4513dc 100644 --- a/src/components/VoiceSearch/__tests__/VoiceSearch-test.tsx +++ b/src/components/VoiceSearch/__tests__/VoiceSearch-test.tsx @@ -14,6 +14,7 @@ const defaultProps: VoiceSearchProps = { voiceListeningState: { status: 'initial', isSpeechFinal: false, + transcript: '', }, templates: { buttonText: 'button', diff --git a/src/lib/voiceSearchHelper/__tests__/index-test.ts b/src/lib/voiceSearchHelper/__tests__/index-test.ts index 5143d3ac6d..2ae8a05c03 100644 --- a/src/lib/voiceSearchHelper/__tests__/index-test.ts +++ b/src/lib/voiceSearchHelper/__tests__/index-test.ts @@ -34,7 +34,7 @@ describe('VoiceSearchHelper', () => { errorCode: undefined, isSpeechFinal: false, status: 'initial', - transcript: undefined, + transcript: '', }); }); diff --git a/src/lib/voiceSearchHelper/index.ts b/src/lib/voiceSearchHelper/index.ts index 5bdafa47f2..bdd9ebb8a0 100644 --- a/src/lib/voiceSearchHelper/index.ts +++ b/src/lib/voiceSearchHelper/index.ts @@ -13,7 +13,7 @@ export type VoiceSearchHelperParams = { export type VoiceListeningState = { status: string; - transcript?: string; + transcript: string; isSpeechFinal: boolean; errorCode?: string; }; @@ -37,7 +37,7 @@ export default function voiceSearchHelper({ (window as any).SpeechRecognition; const getDefaultState = (status: string): VoiceListeningState => ({ status, - transcript: undefined, + transcript: '', isSpeechFinal: false, errorCode: undefined, }); diff --git a/src/widgets/voice-search/__tests__/__snapshots__/voice-search-test.ts.snap b/src/widgets/voice-search/__tests__/__snapshots__/voice-search-test.ts.snap index f423f7c016..da42748063 100644 --- a/src/widgets/voice-search/__tests__/__snapshots__/voice-search-test.ts.snap +++ b/src/widgets/voice-search/__tests__/__snapshots__/voice-search-test.ts.snap @@ -23,7 +23,7 @@ exports[`voiceSearch() Rendering renders during init() 1`] = ` "errorCode": undefined, "isSpeechFinal": false, "status": "initial", - "transcript": undefined, + "transcript": "", } } /> @@ -52,7 +52,7 @@ exports[`voiceSearch() Rendering renders during render() 1`] = ` "errorCode": undefined, "isSpeechFinal": false, "status": "initial", - "transcript": undefined, + "transcript": "", } } /> @@ -81,7 +81,7 @@ exports[`voiceSearch() Rendering renders during render() 2`] = ` "errorCode": undefined, "isSpeechFinal": false, "status": "initial", - "transcript": undefined, + "transcript": "", } } /> diff --git a/stories/voice-search.stories.ts b/stories/voice-search.stories.ts index a8dce262e6..77b77fce95 100644 --- a/stories/voice-search.stories.ts +++ b/stories/voice-search.stories.ts @@ -171,7 +171,7 @@ storiesOf('VoiceSearch', module) status({ isListening, transcript }) { return `
- ${transcript ? transcript : ''} + ${transcript}
`; },