Update tests to handle domain verification

This commit is contained in:
Dries Augustyns
2025-12-01 15:36:31 +01:00
parent e893960a85
commit 54fde9675c
2 changed files with 28 additions and 0 deletions
+21
View File
@@ -86,6 +86,13 @@ export interface WorkflowStepFactoryOptions {
templateId?: string | null;
}
export interface DomainFactoryOptions {
projectId: string;
domain?: string;
verified?: boolean;
dkimTokens?: unknown;
}
export class TestFactories {
private prisma: PrismaClient;
@@ -545,6 +552,20 @@ export class TestFactories {
},
});
}
/**
* Create a domain
*/
async createDomain(options: DomainFactoryOptions) {
return this.prisma.domain.create({
data: {
projectId: options.projectId,
domain: options.domain || 'example.com',
verified: options.verified ?? true,
dkimTokens: options.dkimTokens || null,
},
});
}
}
// Export lazy-initialized singleton instance