/* eslint-env jest */ import { turnRequest } from '../turn-request'; const input = { history: [], route: '/seo/checkup', thinking: 'fast' as const, }; describe('turnRequest', () => { it('sends a turn the page fired as an internal event, which the agent does not bill', () => { expect( turnRequest('Fix this SEO checkup item', { ...input, hidden: true }) .internal_event ).toBe(true); }); it('sends what the merchant typed as their own turn', () => { const request = turnRequest('What is my score?', { ...input, hidden: false, }); expect(request.internal_event).toBe(false); expect(request.context).toEqual({ route: '/seo/checkup', platform: 'WORDPRESS', }); }); });