mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Fix tests again
This commit is contained in:
parent
501147060d
commit
57a094179c
2 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
const React = require('react');
|
||||
const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
|
||||
import {mountWithIntl} from '../../helpers/intl-helpers.jsx';
|
||||
const ComposeComment = require('../../../src/views/preview/comment/compose-comment.jsx');
|
||||
import configureStore from 'redux-mock-store';
|
||||
|
||||
|
@ -138,8 +139,14 @@ describe('Compose Comment test', () => {
|
|||
test('Mute Modal shows when muteOpen is true ', () => {
|
||||
const realDateNow = Date.now.bind(global.Date);
|
||||
global.Date.now = () => 0;
|
||||
const component = getComposeCommentWrapper({});
|
||||
const commentInstance = component.instance();
|
||||
const component = mountWithIntl(
|
||||
<ComposeComment
|
||||
{...defaultProps()}
|
||||
/>
|
||||
, {context: {store}}
|
||||
);
|
||||
// set state on the ComposeComment component, not the wrapper
|
||||
const commentInstance = component.find('ComposeComment').instance();
|
||||
commentInstance.setState({muteOpen: true});
|
||||
component.update();
|
||||
expect(component.find('MuteModal').exists()).toEqual(true);
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('MuteModalTest', () => {
|
|||
const defaultMessages = {
|
||||
commentType: 'comment.type.disrespectful',
|
||||
muteStepHeader: 'comment.disrespectful.header',
|
||||
muteStepContent: 'comment.disrespectful.content'
|
||||
muteStepContent: ['comment.disrespectful.content1', 'comment.disrespectful.content2']
|
||||
};
|
||||
|
||||
test('Mute Modal rendering', () => {
|
||||
|
|
Loading…
Reference in a new issue