From ed5fcfac8a65d8fa81249f819840ad68c9eb7989 Mon Sep 17 00:00:00 2001 From: Sital999 Date: Wed, 13 Nov 2024 15:15:49 +0545 Subject: [PATCH] Update seed file --- integration_test/tests/auth.setup.ts | 2 +- prisma/seed.ts | 77 +++++++++++++++++++++++----- 2 files changed, 64 insertions(+), 15 deletions(-) diff --git a/integration_test/tests/auth.setup.ts b/integration_test/tests/auth.setup.ts index f532d14..7a0032f 100644 --- a/integration_test/tests/auth.setup.ts +++ b/integration_test/tests/auth.setup.ts @@ -9,7 +9,7 @@ import { createAuth } from '@helpers/auth'; const organizerAuthFile = '.auth/organizer.json'; const delegateAuthFile = '.auth/delegate.json'; -const alternateAuthFile = '.auth/organizer.json'; +const alternateAuthFile = '.auth/alternate.json'; setup.beforeEach(async () => { await setAllureEpic('Setup'); diff --git a/prisma/seed.ts b/prisma/seed.ts index 3d71c56..3d97428 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -1,9 +1,12 @@ -import { prisma } from '@/db'; +import { PrismaClient } from '@prisma/client'; + +const prisma = new PrismaClient(); const workshopLocations = [ { name: 'Dubai' }, { name: 'Singapore' }, { name: 'Convention Organizer' }, + { name: 'Buenos Aires' }, ]; const users = [ @@ -12,30 +15,30 @@ const users = [ is_delegate: false, is_alternate: false, workshop_id: BigInt(3), - name: 'Billy Bob', + name: 'Billy Bob Organizer', email: 'billybob@email.com', wallet_address: - 'stake_test3hjbd6o28bup465uqw3ziahm7satj4507tyterkkw91bz7hdwjfro', + 'stake_test1uzmx7hxevy7r63an2v968x4kw5cxdkjw0zwgxe0ph74ad3s7zmcxx', }, { is_convention_organizer: false, is_delegate: true, is_alternate: false, workshop_id: BigInt(1), - name: 'James Jones', + name: 'James Jones delegate', email: 'jamesjones@email.com', wallet_address: - 'stake_test4ilce7p39cvq576vrx4ajbin8ubuk5618uzvftllx02ca8iexksg', + 'stake_test1ur582xvym2mv8qj7xfny5vsm5gn8yxam7er43xu779vh0cq4tpyxh', }, { is_convention_organizer: false, is_delegate: false, is_alternate: true, workshop_id: BigInt(2), - name: 'Sally Sue', + name: 'Sally Sue alternate', email: 'sallysue@email.com', wallet_address: - 'stake_test5jkdf8p40dxr687wsx5bkcoj9vcvl6729vawguomm13db9jfylhtp', + 'stake_test1uqgf7pecctde8ygq25w48k8qrzzr6ap9d5nfwp8436a9g8sdmnp2k', }, { is_convention_organizer: false, @@ -45,24 +48,70 @@ const users = [ name: 'John Doe', email: 'johndoe@email.com', wallet_address: - 'stake_test5jkdf8p40dxr687wsx5bkcoj9vcvl6729vawguomm13db9jfueijd', + 'stake_test1uzryp0nzykrdmnxuu8nsu9q2vz2a22l9upq4ckn4p5uqhjgvkdd6g', + }, + { + is_convention_organizer: false, + is_delegate: false, + is_alternate: true, + workshop_id: BigInt(1), + name: 'Roy James', + email: 'Royjames@email.com', + wallet_address: + 'stake_test1uq2c7pdk3nr0mtsl9z47redcc38pvchz5czryeh643ecvpgu5v0gr', + }, + { + is_convention_organizer: true, + is_delegate: false, + is_alternate: false, + workshop_id: BigInt(3), + name: 'Test organizer', + email: 'testOrganizer@email.com', + wallet_address: + 'stake_test1urrfysygca8m9x0qypxrutl5j2n9c252mev4qmwdtzwqr6g6dj7kn', + }, + { + is_convention_organizer: false, + is_delegate: false, + is_alternate: true, + workshop_id: BigInt(4), + name: 'Test alternate', + email: 'testalternate@email.com', + wallet_address: + 'stake_test1up646zdqul0wud00ss0vszpf9g22uqc0r4k4tv7gtv8edqs5nrfs7', + }, + { + is_convention_organizer: false, + is_delegate: true, + is_alternate: false, + workshop_id: BigInt(4), + name: 'Test delegate', + email: 'testdelegate@email.com', + wallet_address: + 'stake_test1upzv3vmy37a0zk743vjfaexrxvnnv7fyhrdg5ncla6dknksjfxrpy', }, ]; const workshopInfo = [ { name: 'Dubai', - delegate_id: BigInt(1), - alternate_id: BigInt(2), - active_vote_id: BigInt(1), + delegate_id: BigInt(2), + alternate_id: BigInt(5), + active_vote_id: BigInt(2), }, { name: 'Singapore', - delegate_id: BigInt(3), - alternate_id: BigInt(4), - active_vote_id: BigInt(4), + delegate_id: BigInt(4), + alternate_id: BigInt(3), + active_vote_id: BigInt(3), }, { name: 'Convention Organizer' }, + { + name: 'Buenos Aires', + delegate_id: BigInt(8), + alternate_id: BigInt(7), + active_vote_id: BigInt(8), + }, ]; const seedDB = async (): Promise => {