feat(settings): add CFDM API URL handling and improve integration form
Docker / build (push) Failing after 22s
Docker / build (push) Failing after 22s
Introduced a new test to verify the persistence of the CFDM API URL via the settings endpoint. Updated the integration form to reflect saved credentials more clearly, enhancing user feedback for the API URL and integration token. Improved sync button behavior to prevent actions without saved credentials. Updated settings schema to include CFDM API URL validation.
This commit is contained in:
@@ -101,6 +101,19 @@ describe('settings cfdm sync', () => {
|
||||
closeDb()
|
||||
})
|
||||
|
||||
it('persists cfdmApiUrl via PUT settings', async () => {
|
||||
const res = await app.inject({
|
||||
method: 'PUT',
|
||||
url: '/api/settings/settings-main',
|
||||
payload: { cfdmApiUrl: 'http://192.168.100.67:6363' },
|
||||
})
|
||||
expect(res.statusCode).toBe(200)
|
||||
expect(res.json()).toMatchObject({ cfdmApiUrl: 'http://192.168.100.67:6363' })
|
||||
|
||||
const dto = settingsRepository.get('settings-main')
|
||||
expect(dto?.cfdmApiUrl).toBe('http://192.168.100.67:6363')
|
||||
})
|
||||
|
||||
it('requests full sync from CFDM', async () => {
|
||||
const fetchMock = vi.fn(async () => Response.json({ ok: true, count: 3 }))
|
||||
vi.stubGlobal('fetch', fetchMock)
|
||||
|
||||
Reference in New Issue
Block a user