diff --git a/app/javascript/article-form/__tests__/articleForm.test.jsx b/app/javascript/article-form/__tests__/articleForm.test.jsx index b4079f920..0b1d1ff43 100644 --- a/app/javascript/article-form/__tests__/articleForm.test.jsx +++ b/app/javascript/article-form/__tests__/articleForm.test.jsx @@ -60,6 +60,15 @@ describe('', () => { form.find('.clear').simulate('click'); expect(form.state().bodyMarkdown).toBe(''); }); + + it('toggles help on help button press', () => { + const form = deep(getArticleForm()); + global.scrollTo = jest.fn(); + form.find('.articleform__buttons--small').simulate('click', { preventDefault: () => {} }); + expect(form.state().helpShowing).toBe(true); + form.find('.articleform__buttons--small').simulate('click', { preventDefault: () => {} }); + expect(form.state().helpShowing).toBe(false); + }); }); const getArticleForm = () => (