chore: remediate CI blockers for production readiness
This commit is contained in:
@@ -50,6 +50,16 @@ export async function loginUser(
|
||||
return res.json();
|
||||
}
|
||||
|
||||
/** Logs in the seeded admin created by prisma/seed.ts for E2E admin happy paths. */
|
||||
export async function loginSeedAdmin(request: APIRequestContext): Promise<TokenPair> {
|
||||
const phone = process.env['E2E_ADMIN_PHONE'] ?? '0876677771';
|
||||
const password = process.env['SEED_DEFAULT_PASSWORD'];
|
||||
if (!password) {
|
||||
throw new Error('SEED_DEFAULT_PASSWORD is required to log in the seeded admin user');
|
||||
}
|
||||
return loginUser(request, phone, password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extended test fixture that provides a pre-authenticated API context.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export { test, expect } from './auth.fixture';
|
||||
export { createTestUser, registerUser, loginUser } from './auth.fixture';
|
||||
export { createTestUser, registerUser, loginUser, loginSeedAdmin } from './auth.fixture';
|
||||
export type { TokenPair } from './auth.fixture';
|
||||
export { createTestListing, createListing } from './listings.fixture';
|
||||
export { buildVnpayCallbackData, buildMomoCallbackData } from './payments.fixture';
|
||||
|
||||
Reference in New Issue
Block a user