chore: snapshot before performance optimization

This commit is contained in:
Sepehr Ramezani
2026-04-17 21:14:43 +02:00
parent b6a548acd8
commit 2eceb32fd4
95 changed files with 4357 additions and 1942 deletions

View File

@@ -6,7 +6,6 @@
import { PrismaClient } from '@prisma/client'
import {
setupTestEnvironment,
createTestPrismaClient,
initializeTestDatabase,
cleanupTestDatabase,
@@ -20,7 +19,6 @@ describe('Schema Migration Tests', () => {
let prisma: PrismaClient
beforeAll(async () => {
await setupTestEnvironment()
prisma = createTestPrismaClient()
await initializeTestDatabase(prisma)
})
@@ -294,7 +292,7 @@ describe('Schema Migration Tests', () => {
test('should have indexes on Note table', async () => {
// Note table should have indexes on various columns
const schema = await getTableSchema(prisma, 'sqlite_master')
const schema = await getTableSchema(prisma, 'Note')
expect(schema).toBeDefined()
})
})
@@ -504,14 +502,11 @@ describe('Schema Migration Tests', () => {
describe('Schema Version Tracking', () => {
test('should have all migrations applied', async () => {
// Check that the migration tables exist
const migrationsExist = await verifyTableExists(prisma, '_prisma_migrations')
// In SQLite with Prisma, migrations are tracked via _prisma_migrations table
// For this test, we just verify the schema is complete
// Verify the schema is complete by checking core tables
const hasUser = await verifyTableExists(prisma, 'User')
const hasNote = await verifyTableExists(prisma, 'Note')
const hasAiFeedback = await verifyTableExists(prisma, 'AiFeedback')
expect(hasUser && hasNote && hasAiFeedback).toBe(true)
})
})