test(settings): cover fill-crop preference sync payload

Guard against the display preference mismatch reported in #1290 by checking author fields in cover-mode saves and verifying server acceptance of the complete payload.

Ref #1290
This commit is contained in:
neon
2026-09-09 03:12:16 +00:00
parent b9609b198e
commit 7978ab0230
2 changed files with 23 additions and 1 deletions
@@ -150,9 +150,18 @@ describe('useDisplaySettingsSync', () => {
'/api/v1/user-preferences/display',
expect.objectContaining({
method: 'PUT',
body: expect.stringContaining('"bookCoverDisplayMode":"fill-crop"'),
body: expect.any(String),
}),
)
const request = apiMock.mock.calls[0]?.[1] as RequestInit
expect(JSON.parse(request.body as string)).toMatchObject({
settings: {
authorRowDensity: 'comfortable',
authorCoverFallback: false,
bookCoverDisplayMode: 'fill-crop',
},
})
})
it('cancels a pending debounced save', async () => {