♻️ (viewer) Change to features-centric folder structure
This commit is contained in:
committed by
Baptiste Arnaud
parent
643571fe7d
commit
a9d04798bc
23
apps/viewer/src/test/utils/databaseActions.ts
Normal file
23
apps/viewer/src/test/utils/databaseActions.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { CredentialsType, SmtpCredentialsData } from 'models'
|
||||
import { PrismaClient } from 'db'
|
||||
import { encrypt } from 'utils/api'
|
||||
import { proWorkspaceId } from 'utils/playwright/databaseSetup'
|
||||
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
export const createSmtpCredentials = (
|
||||
id: string,
|
||||
smtpData: SmtpCredentialsData
|
||||
) => {
|
||||
const { encryptedData, iv } = encrypt(smtpData)
|
||||
return prisma.credentials.create({
|
||||
data: {
|
||||
id,
|
||||
data: encryptedData,
|
||||
iv,
|
||||
name: smtpData.from.email as string,
|
||||
type: CredentialsType.SMTP,
|
||||
workspaceId: proWorkspaceId,
|
||||
},
|
||||
})
|
||||
}
|
||||
4
apps/viewer/src/test/utils/playwright.ts
Normal file
4
apps/viewer/src/test/utils/playwright.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import path from 'path'
|
||||
|
||||
export const getTestAsset = (name: string) =>
|
||||
path.join(__dirname, '..', 'assets', name)
|
||||
Reference in New Issue
Block a user