Commit 0a8d8ad6 authored by seotts's avatar seotts

Fix and add tests for feedback link

parent 5a3250ed
...@@ -117,9 +117,12 @@ describe('MuteModalTest', () => { ...@@ -117,9 +117,12 @@ describe('MuteModalTest', () => {
expect(component.instance().state.step).toBe(0); expect(component.instance().state.step).toBe(0);
}); });
test('Mute modal asks for feedback', () => { test('Mute modal asks for feedback if showFeedback', () => {
const component = mountWithIntl( const component = mountWithIntl(
<MuteModal muteModalMessages={defaultMessages} /> <MuteModal
showFeedback
muteModalMessages={defaultMessages}
/>
); );
component.find('MuteModal').instance() component.find('MuteModal').instance()
.setState({step: 1}); .setState({step: 1});
...@@ -127,9 +130,22 @@ describe('MuteModalTest', () => { ...@@ -127,9 +130,22 @@ describe('MuteModalTest', () => {
expect(component.find('p.feedback-prompt').exists()).toEqual(true); 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(
<MuteModal
muteModalMessages={defaultMessages}
/>
);
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( const component = mountWithIntl(
<MuteModal <MuteModal
showFeedback
showWarning showWarning
muteModalMessages={defaultMessages} muteModalMessages={defaultMessages}
/> />
...@@ -158,6 +174,12 @@ describe('MuteModalTest', () => { ...@@ -158,6 +174,12 @@ describe('MuteModalTest', () => {
const component = shallowWithIntl( const component = shallowWithIntl(
<MuteModal <MuteModal
muteModalMessages={defaultMessages} muteModalMessages={defaultMessages}
user={{
id: 12345,
username: 'myusername',
token: 'mytoken',
thumbnailUrl: 'mythumbnail'
}}
/> />
).dive(); ).dive();
component.instance().handleFeedbackSubmit('something'); component.instance().handleFeedbackSubmit('something');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment