/* eslint-env jest, browser */ import replace from '../replace'; jest.mock('../../dist/icons.json', () => ({ icon1: '', icon2: '', })); test('replaces [data-feather] elements with SVG markup', () => { document.body.innerHTML = ''; expect(document.body.innerHTML).toMatchSnapshot(); replace(); expect(document.body.innerHTML).toMatchSnapshot(); }); test('copies placeholder element attributes to tag', () => { document.body.innerHTML = ''; expect(document.body.innerHTML).toMatchSnapshot(); replace(); expect(document.body.innerHTML).toMatchSnapshot(); }); test('sets attributes passed as parameters', () => { document.body.innerHTML = ''; expect(document.body.innerHTML).toMatchSnapshot(); replace({ class: 'foo bar hello', 'stroke-width': 1.5, color: 'salmon' }); expect(document.body.innerHTML).toMatchSnapshot(); });