Files
API/test/feedback/honeypot.test.ts
Paddy b05f6b9da0
Jenkins Production Deployment
Add Feedback domain module: public submission flow, admin CRUD, reporting (#7)
Co-authored-by: Patrick Müller <mail@pmueller.me>
Reviewed-on: #7
Co-authored-by: Patrick Mueller <patrick@mueller-patrick.tech>
Co-committed-by: Patrick Mueller <patrick@mueller-patrick.tech>
2026-08-23 09:39:02 +00:00

17 lines
533 B
TypeScript

import {isHoneypotTriggered} from '../../src/models/feedback/public/public.router';
describe('isHoneypotTriggered', () => {
it('is false when the field is absent', () => {
expect(isHoneypotTriggered({})).toBe(false);
});
it('is false when the field is empty', () => {
expect(isHoneypotTriggered({website: ''})).toBe(false);
expect(isHoneypotTriggered({website: ' '})).toBe(false);
});
it('is true when a bot filled it in', () => {
expect(isHoneypotTriggered({website: 'https://spam.example'})).toBe(true);
});
});