fix: update Prisma client configuration and test files for Prisma 7.x compatibility

This commit is contained in:
2026-03-31 10:41:04 -07:00
parent a960bb8a41
commit d595dfa62d
9 changed files with 12 additions and 18 deletions
@@ -8,9 +8,7 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
const prisma = new PrismaClient();
// Generate unique test account credentials // Generate unique test account credentials
function getTestCredentials() { function getTestCredentials() {
+1 -3
View File
@@ -8,9 +8,7 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
const prisma = new PrismaClient();
// Generate unique test account credentials // Generate unique test account credentials
function getTestCredentials() { function getTestCredentials() {
@@ -5,11 +5,10 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
const prisma = new PrismaClient();
test.describe('CSV Upload Player Deduplication', () => { test.describe('CSV Upload Player Deduplication', () => {
let testTournamentId: number; let testTournamentId: number;
+1 -2
View File
@@ -5,11 +5,10 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
const prisma = new PrismaClient();
test.describe('Elo Rating Updates', () => { test.describe('Elo Rating Updates', () => {
test.beforeAll(async () => { test.beforeAll(async () => {
+1 -2
View File
@@ -11,9 +11,8 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
const prisma = new PrismaClient();
function getTestCredentials() { function getTestCredentials() {
const timestamp = Date.now(); const timestamp = Date.now();
@@ -13,9 +13,8 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
const prisma = new PrismaClient();
function getTestCredentials() { function getTestCredentials() {
const timestamp = Date.now(); const timestamp = Date.now();
@@ -12,9 +12,8 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
const prisma = new PrismaClient();
function getTestCredentials() { function getTestCredentials() {
const timestamp = Date.now(); const timestamp = Date.now();
@@ -6,9 +6,8 @@
*/ */
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma';
const prisma = new PrismaClient();
test.describe('Tournament Admin Permissions', () => { test.describe('Tournament Admin Permissions', () => {
let tournamentId: number; let tournamentId: number;
+4
View File
@@ -1,6 +1,10 @@
import { PrismaClient } from '@prisma/client' import { PrismaClient } from '@prisma/client'
import { PrismaPg } from '@prisma/adapter-pg' import { PrismaPg } from '@prisma/adapter-pg'
import pg from 'pg' import pg from 'pg'
import dotenv from 'dotenv'
// Load .env file if it exists
dotenv.config()
const globalForPrisma = globalThis as unknown as { const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined prisma: PrismaClient | undefined