mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
test: add test for 500 response preserving config
Verify that non-auth server errors (like 500) do not clear the existing config, documenting the expected behavior that config is only cleared on 401/403 responses
This commit is contained in:
@@ -107,5 +107,20 @@ describe('refreshRemoteConfig', () => {
|
|||||||
expect(remoteConfig.value).toEqual({})
|
expect(remoteConfig.value).toEqual({})
|
||||||
expect(window.__CONFIG__).toEqual({})
|
expect(window.__CONFIG__).toEqual({})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('preserves config on 500 response', async () => {
|
||||||
|
const existingConfig = { subscription_required: true }
|
||||||
|
remoteConfig.value = existingConfig
|
||||||
|
window.__CONFIG__ = existingConfig
|
||||||
|
|
||||||
|
vi.mocked(api.fetchApi).mockResolvedValue(
|
||||||
|
mockErrorResponse(500, 'Internal Server Error')
|
||||||
|
)
|
||||||
|
|
||||||
|
await refreshRemoteConfig()
|
||||||
|
|
||||||
|
expect(remoteConfig.value).toEqual(existingConfig)
|
||||||
|
expect(window.__CONFIG__).toEqual(existingConfig)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user