fix: clear external player paths on save

Entire-Checkpoint: f957cd9849e0
This commit is contained in:
4gray committed 2026-05-04 23:26:56 +02:00
1 parent 2efdfea0c1
commit 4a21579aff
4 files changed
+111 -22

No files matched your search

@@ -925,4 +925,28 @@ describe('SettingsComponent', () => {
component.settingsForm.value
);
});
it('clears external player paths in Electron when saved as empty', async () => {
const mockStore = settingsStore as unknown as MockSettingsStore;
mockStore.updateSettings.mockResolvedValue(undefined);
const setMpvPlayerPath = jest.spyOn(
window.electron,
'setMpvPlayerPath'
);
const setVlcPlayerPath = jest.spyOn(
window.electron,
'setVlcPlayerPath'
);
component.settingsForm.patchValue({
mpvPlayerPath: '',
vlcPlayerPath: '',
});
component.onSubmit();
await fixture.whenStable();
expect(setMpvPlayerPath).toHaveBeenCalledWith('');
expect(setVlcPlayerPath).toHaveBeenCalledWith('');
});
});