import Store from '~/issue_show/stores'; import updateDescription from '~/issue_show/utils/update_description'; jest.mock('~/issue_show/utils/update_description'); describe('Store', () => { let store; beforeEach(() => { store = new Store({ descriptionHtml: '

This is a description

', }); }); describe('updateState', () => { beforeEach(() => { document.body.innerHTML = `
One
Two
`; }); afterEach(() => { document.getElementsByTagName('html')[0].innerHTML = ''; }); it('calls updateDetailsState', () => { store.updateState({ description: '' }); expect(updateDescription).toHaveBeenCalledTimes(1); }); }); });