Dev and Test run fixed. New Datepicker. Tests fixed. Message bookmarking fixed.

This commit is contained in:
aodulov
2025-12-18 14:06:45 +02:00
parent e9aec9a65d
commit 3a8f132b91
12 changed files with 347 additions and 24 deletions

View File

@@ -15,10 +15,8 @@ type MyFixtures = {
// Extend the base test with our custom fixture
export const test = base.extend<MyFixtures>({
createUniqueUser: async ({ }, use) => {
// We use a new API context for setup to avoid polluting request history,
// although setup requests are usually separate anyway.
const apiContext = await request.newContext({
baseURL: 'http://127.0.0.1:3001' // Direct access to backend
baseURL: 'http://127.0.0.1:3201' // Direct access to backend
});
// Setup: Helper function to create a user
@@ -48,12 +46,6 @@ export const test = base.extend<MyFixtures>({
// Use the fixture
await use(createUser);
// Cleanup: In a real "test:full" env with ephemeral db, cleanup might not be needed.
// But if we want to be clean, we can delete the user.
// Requires admin privileges usually, or specific delete-me endpoint.
// Given the requirements "delete own account" exists (5.6), we could theoretically login and delete.
// For now we skip auto-cleanup to keep it simple, assuming test DB is reset periodically.
},
createAdminUser: async ({ createUniqueUser }, use) => {
@@ -65,7 +57,7 @@ export const test = base.extend<MyFixtures>({
try {
const { stdout, stderr } = await exec(`npx ts-node promote_admin.ts ${user.email}`, {
cwd: 'server',
env: { ...process.env, APP_MODE: 'test', DATABASE_URL: 'file:d:/Coding/gymflow/server/test.db', DATABASE_URL_TEST: 'file:d:/Coding/gymflow/server/test.db' }
env: { ...process.env, APP_MODE: 'test', DATABASE_URL: 'file:d:/Coding/gymflow/server/prisma/test.db', DATABASE_URL_TEST: 'file:d:/Coding/gymflow/server/prisma/test.db' }
});
if (stderr) {
console.error(`Promote Admin Stderr: ${stderr}`);