diff --git a/frontend/tests/factories/totp.ts b/frontend/tests/factories/totp.ts new file mode 100644 index 000000000..5f96f6264 --- /dev/null +++ b/frontend/tests/factories/totp.ts @@ -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`, + } + } +}