/* eslint-env jest */ import { scanButtonCopy } from '../scan-button'; describe('scanButtonCopy', () => { it('says what a scan costs before it is pressed', () => { expect(scanButtonCopy(false, 250)).toEqual({ label: 'Force scan now ยท 250 credits', title: 'Force scan now. Costs 250 credits, debited when the scan runs.', opensSettings: false, }); }); it('stays plain while the price is not known', () => { expect(scanButtonCopy(false, null).label).toBe('Force scan now'); expect(scanButtonCopy(false, 0).label).toBe('Force scan now'); }); it('asks for the language and country first, and leads there', () => { expect(scanButtonCopy(true, 25)).toMatchObject({ label: 'Set language & country', opensSettings: true, }); }); });