Add API integration test suite with Postgres and ClickHouse coverage
This commit is contained in:
1 parent
950ae63f87
commit
e18769e8cf
59 files changed
+8971
-28
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import type { ApiClient } from '../client';
|
||||
|
||||
export interface Credentials {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export async function login(api: ApiClient, { username, password }: Credentials) {
|
||||
const response = await api.post('/api/auth/login', { username, password });
|
||||
|
||||
if (response.status !== 200 || !response.body?.token) {
|
||||
throw new Error(`Login failed for ${username} (${response.status}): ${response.text}`);
|
||||
}
|
||||
|
||||
return response.body.token as string;
|
||||
}
|
||||
Reference in new issue
Block a user