Skip to content

Commit

Permalink
fix(types): make transcript non-optional string
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunjae Lee committed May 15, 2019
1 parent eaa0b14 commit e2717c1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/components/VoiceSearch/__tests__/VoiceSearch-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const defaultProps: VoiceSearchProps = {
voiceListeningState: {
status: 'initial',
isSpeechFinal: false,
transcript: '',
},
templates: {
buttonText: 'button',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/voiceSearchHelper/__tests__/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('VoiceSearchHelper', () => {
errorCode: undefined,
isSpeechFinal: false,
status: 'initial',
transcript: undefined,
transcript: '',
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/lib/voiceSearchHelper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type VoiceSearchHelperParams = {

export type VoiceListeningState = {
status: string;
transcript?: string;
transcript: string;
isSpeechFinal: boolean;
errorCode?: string;
};
Expand All @@ -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,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports[`voiceSearch() Rendering renders during init() 1`] = `
"errorCode": undefined,
"isSpeechFinal": false,
"status": "initial",
"transcript": undefined,
"transcript": "",
}
}
/>
Expand Down Expand Up @@ -52,7 +52,7 @@ exports[`voiceSearch() Rendering renders during render() 1`] = `
"errorCode": undefined,
"isSpeechFinal": false,
"status": "initial",
"transcript": undefined,
"transcript": "",
}
}
/>
Expand Down Expand Up @@ -81,7 +81,7 @@ exports[`voiceSearch() Rendering renders during render() 2`] = `
"errorCode": undefined,
"isSpeechFinal": false,
"status": "initial",
"transcript": undefined,
"transcript": "",
}
}
/>
Expand Down
2 changes: 1 addition & 1 deletion stories/voice-search.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ storiesOf('VoiceSearch', module)
status({ isListening, transcript }) {
return `
<div class="layer listening-${isListening}">
<span>${transcript ? transcript : ''}</span>
<span>${transcript}</span>
</div>
`;
},
Expand Down

0 comments on commit e2717c1

Please sign in to comment.