test(e2e): add TotpFactory with fixed seed

This commit is contained in:
kolaente 2026-04-21 10:44:35 +02:00 committed by kolaente
parent 3271c8600a
commit 3816349258
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
import {Factory} from '../support/factory'
// Fixed base32 secret so tests can generate deterministic codes with otplib.
export const FIXED_TOTP_SECRET = 'JBSWY3DPEHPK3PXP'
export class TotpFactory extends Factory {
static table = 'totp'
static factory() {
return {
id: '{increment}',
user_id: 1,
secret: FIXED_TOTP_SECRET,
enabled: true,
url: `otpauth://totp/Vikunja:test?secret=${FIXED_TOTP_SECRET}&issuer=Vikunja`,
}
}
}