Fix tests again

This commit is contained in:
Chris Garrity 2020-12-11 14:42:06 -05:00
parent 501147060d
commit 57a094179c
2 changed files with 10 additions and 3 deletions

View file

@ -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);

View file

@ -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', () => {