import updateDescription from '~/issue_show/utils/update_description'; describe('updateDescription', () => { it('returns the correct value to be set as descriptionHtml', () => { const actual = updateDescription( '
One
Two
', [{ open: true }, { open: false }], // mocking NodeList from the dom. ); expect(actual).toEqual( '
One
Two
', ); }); describe('when description details returned from api is different then whats currently on the dom', () => { it('returns the description from the api', () => { const dataDescription = '
One
'; const actual = updateDescription(dataDescription, []); expect(actual).toEqual(dataDescription); }); }); });