mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-01-18 18:57:51 -05:00
* setting up test structure * . * added playwright config file, deleted original playwright folder and moved "some.test" file * continued test structure setup * Updating test folder structure * Added database seeding script and backend testing folder structure * removed the database test * Replaced db seeding script * Updated userInformation.ts to use values from choices.tsx * merge prep * removing extra unit test, moving api test to correct folder * Pushing to get help with sql Unit test * Updating get-profiles unit tests * Added more unit tests * . * Added more unit tests * Added getSupabaseToken unit test * . * excluding supabase token test so ci can pass * . * Seperated the seedDatabase func into its own file so it can be accessed seperatly * Fixed failing test * . * . * Fix tests * Fix lint * Clean --------- Co-authored-by: MartinBraquet <martin.braquet@gmail.com>
28 lines
934 B
TypeScript
28 lines
934 B
TypeScript
//Run with:
|
|
// export ENVIRONMENT=DEV && ./scripts/build_api.sh && npx tsx ./scripts/userCreation.ts
|
|
|
|
import {createSupabaseDirectClient} from "../backend/shared/lib/supabase/init";
|
|
import UserAccountInformation from "../tests/e2e/backend/utils/userInformation";
|
|
import { seedDatabase } from "../tests/e2e/utils/seedDatabase";
|
|
|
|
type ProfileType = 'basic' | 'medium' | 'full'
|
|
|
|
|
|
(async () => {
|
|
const pg = createSupabaseDirectClient()
|
|
|
|
//Edit the count seedConfig to specify the amount of each profiles to create
|
|
const seedConfig = [
|
|
{ count: 1, profileType: 'basic' as ProfileType },
|
|
{ count: 1, profileType: 'medium' as ProfileType },
|
|
{ count: 1, profileType: 'full' as ProfileType },
|
|
]
|
|
|
|
for (const {count, profileType } of seedConfig) {
|
|
for (let i = 0; i < count; i++) {
|
|
const userInfo = new UserAccountInformation()
|
|
await seedDatabase(pg, userInfo, profileType)
|
|
}
|
|
}
|
|
process.exit(0)
|
|
})() |