Add tests for settings database runtime configuration API
- Implement tests for retrieving and saving runtime database configuration. - Validate handling of invalid configuration payloads. - Utilize Fastify for API testing with Vitest. - Ensure proper cleanup of database state between tests.
This commit is contained in:
@@ -202,6 +202,12 @@ export const api = {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(data),
|
||||
}),
|
||||
getRuntimeDatabaseConfig: () => request('/api/settings/database/runtime'),
|
||||
updateRuntimeDatabaseConfig: (data: { dialect: 'sqlite' | 'mysql' | 'postgres'; connectionString: string }) =>
|
||||
request('/api/settings/database/runtime', {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(data),
|
||||
}),
|
||||
testExternalDatabaseConnection: (data: { dialect: 'sqlite' | 'mysql' | 'postgres'; connectionString: string; overwrite?: boolean }) =>
|
||||
request('/api/settings/database/test-connection', {
|
||||
method: 'POST',
|
||||
|
||||
+357
-125
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user