diff --git a/desktop-client/tests/state.test.js b/desktop-client/tests/state.test.js index 9c9f3b6..408153f 100644 --- a/desktop-client/tests/state.test.js +++ b/desktop-client/tests/state.test.js @@ -45,3 +45,15 @@ test('mergeState does not mutate inputs', () => { assert.deepEqual(current, before); assert.deepEqual(update, { title: 'X' }); }); + +test('mergeState treats null fields as no-change', () => { + const current = { ...initialState, title: 'Previous' }; + const next = mergeState(current, { title: null }); + assert.equal(next.title, 'Previous'); +}); + +test('mergeState applies 0 as a real value (not a no-change)', () => { + const current = { ...initialState, progress: 42 }; + const next = mergeState(current, { progress: 0 }); + assert.equal(next.progress, 0); +});