From 0a8d8ad6c551f1edbdedeaf4ae8506c62f20df10 Mon Sep 17 00:00:00 2001 From: seotts Date: Thu, 11 Feb 2021 15:44:25 -0500 Subject: [PATCH] Fix and add tests for feedback link --- test/unit/components/mute-modal.test.jsx | 28 +++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/test/unit/components/mute-modal.test.jsx b/test/unit/components/mute-modal.test.jsx index e025ddd90..9601e97fc 100644 --- a/test/unit/components/mute-modal.test.jsx +++ b/test/unit/components/mute-modal.test.jsx @@ -117,9 +117,12 @@ describe('MuteModalTest', () => { expect(component.instance().state.step).toBe(0); }); - test('Mute modal asks for feedback', () => { + test('Mute modal asks for feedback if showFeedback', () => { const component = mountWithIntl( - + ); component.find('MuteModal').instance() .setState({step: 1}); @@ -127,9 +130,22 @@ describe('MuteModalTest', () => { expect(component.find('p.feedback-prompt').exists()).toEqual(true); }); - test('Mute modal asks for feedback on extra showWarning step', () => { + test('Mute modal do not ask for feedback if not showFeedback', () => { const component = mountWithIntl( + ); + component.find('MuteModal').instance() + .setState({step: 1}); + component.update(); + expect(component.find('p.feedback-prompt').exists()).toEqual(false); + }); + + test('Mute modal asks for feedback on extra showWarning step if showFeedback', () => { + const component = mountWithIntl( + @@ -158,6 +174,12 @@ describe('MuteModalTest', () => { const component = shallowWithIntl( ).dive(); component.instance().handleFeedbackSubmit('something');