mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -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);
|
||||
});
|
||||
|
||||
test('Mute modal asks for feedback', () => {
|
||||
test('Mute modal asks for feedback if showFeedback', () => {
|
||||
const component = mountWithIntl(
|
||||
<MuteModal muteModalMessages={defaultMessages} />
|
||||
<MuteModal
|
||||
showFeedback
|
||||
muteModalMessages={defaultMessages}
|
||||
/>
|
||||
);
|
||||
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(
|
||||
<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
|
||||
muteModalMessages={defaultMessages}
|
||||
/>
|
||||
|
@ -158,6 +174,12 @@ describe('MuteModalTest', () => {
|
|||
const component = shallowWithIntl(
|
||||
<MuteModal
|
||||
muteModalMessages={defaultMessages}
|
||||
user={{
|
||||
id: 12345,
|
||||
username: 'myusername',
|
||||
token: 'mytoken',
|
||||
thumbnailUrl: 'mythumbnail'
|
||||
}}
|
||||
/>
|
||||
).dive();
|
||||
component.instance().handleFeedbackSubmit('something');
|
||||
|
|
Loading…
Reference in a new issue