mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 10:58:23 -05:00
Fix and add tests for feedback link
This commit is contained in:
parent
5a3250edd5
commit
0a8d8ad6c5
1 changed files with 25 additions and 3 deletions
|
@ -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', () => {
|
||||||
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(
|
const component = mountWithIntl(
|
||||||
<MuteModal
|
<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(
|
||||||
|
<MuteModal
|
||||||
|
showFeedback
|
||||||
showWarning
|
showWarning
|
||||||
muteModalMessages={defaultMessages}
|
muteModalMessages={defaultMessages}
|
||||||
/>
|
/>
|
||||||
|
@ -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');
|
||||||
|
|
Loading…
Reference in a new issue