Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(settings): move pending status mock to correct test case

Steven Enamakeldb5f11a4970b
diff --git a/app/src/components/settings/panels/__tests__/VoicePanel.test.tsx b/app/src/components/settings/panels/__tests__/VoicePanel.test.tsx
index 9b57727cd2..35aa17fc51 100644
--- a/app/src/components/settings/panels/__tests__/VoicePanel.test.tsx
+++ b/app/src/components/settings/panels/__tests__/VoicePanel.test.tsx
@@ -217,10 +217,6 @@ describe('VoicePanel', () => {
const sttSelect = (await screen.findByTestId('stt-provider-select')) as HTMLSelectElement;
await waitFor(() => expect(sttSelect.value).toBe('elevenlabs'));
- // Keep the saveRouting refresh pending so it does not clear the error set
- // by the failed persistence attempt.
- vi.mocked(openhumanVoiceStatus).mockImplementation(() => new Promise(() => {}));
-
// Switch back to cloud, then save.
fireEvent.change(sttSelect, { target: { value: 'cloud' } });
await waitFor(() => expect(sttSelect.value).toBe('cloud'));
@@ -283,6 +279,10 @@ describe('VoicePanel', () => {
const sttSelect = (await screen.findByTestId('stt-provider-select')) as HTMLSelectElement;
await waitFor(() => expect(sttSelect.value).toBe('elevenlabs'));
+ // Keep the saveRouting refresh pending so it does not clear the error set
+ // by the failed persistence attempt.
+ vi.mocked(openhumanVoiceStatus).mockImplementation(() => new Promise(() => {}));
+
// Change provider and click save to trigger the RPC error.
fireEvent.change(sttSelect, { target: { value: 'cloud' } });
const saveBtn = screen.getByTestId('save-voice-routing');