/* eslint-env jest */ import { headStatus } from '../status-strip'; const base = { outputEnabled: true, rival: '', headOn: true, schemaOn: true }; describe('the head output tile', () => { it('says what is printed only when it is', () => { expect(headStatus(base).text).toContain('Open Graph and schema'); expect(headStatus({ ...base, schemaOn: false }).text).toContain( 'the schema module is off' ); expect(headStatus({ ...base, headOn: false }).text).toMatch(/^Schema only/); }); it('is off when both modules are', () => { const off = headStatus({ ...base, headOn: false, schemaOn: false }); expect(off.value).toBe('Off'); expect(off.tone).toBe('off'); }); it('yields to another SEO plugin whatever the modules say', () => { const rival = headStatus({ ...base, outputEnabled: false, rival: 'Yoast SEO 28.5', }); expect(rival.value).toBe('Yielding to Yoast SEO 28.5'); expect(rival.tone).toBe('yield'); }); });