Skip to content

fix: update SpeechProvider tests for ElevenLabs API key integration#2135

Open
rustforrecess wants to merge 1 commit intocboard-org:masterfrom
rustforrecess:fix/speech-provider-tests-elevenlabs
Open

fix: update SpeechProvider tests for ElevenLabs API key integration#2135
rustforrecess wants to merge 1 commit intocboard-org:masterfrom
rustforrecess:fix/speech-provider-tests-elevenlabs

Conversation

@rustforrecess
Copy link
Copy Markdown

Summary

Fixes failing SpeechProvider tests after the ElevenLabs API key integration (#2052).

  • Reducer test: Updated initialState to include the 5 new fields added by the ElevenLabs integration (elevenLabsApiKey, elevenLabsVoiceSettings, and three new options fields). Added test case for CHANGE_ELEVENLABS_API_KEY action.
  • Actions test: Mocked the tts module to fix the store.getState() crash (tts now depends on the Redux store). Mocked window.speechSynthesis for JSDOM compatibility. Updated changeVoice test to use mockStore dispatch since it was refactored into a thunk. Added test for changeElevenLabsApiKey action creator.

Test plan

  • Run npx react-scripts test --watchAll=false --testPathPattern=Speech — all 3 suites should pass (20 tests)
  • Confirm no regressions in the broader test suite

Closes #2052

🤖 Generated with Claude Code

- Add missing ElevenLabs fields to reducer test initialState
- Add CHANGE_ELEVENLABS_API_KEY test to reducer tests
- Mock tts module in actions tests to fix store.getState() crash
- Mock window.speechSynthesis for JSDOM compatibility
- Update changeVoice test to use mockStore dispatch (now a thunk)
- Add changeElevenLabsApiKey action test

Closes cboard-org#2052

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SpeechProvider tests fails after ElevenLabs API key integration

1 participant