1
0
forked from boos/BoosAPI

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:
cita
2026-03-05 18:57:18 +08:00
parent 283c052fa5
commit b122893796
6 changed files with 715 additions and 180 deletions
+6
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff