Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaap committed Sep 28, 2020
1 parent ae4e2eb commit f147f1e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Message/MessageOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ const MessageOptionsComponent = (props) => {
messageActions.indexOf(MESSAGE_ACTIONS.react) > -1 &&
channelConfig &&
channelConfig.reactions;

const shouldShowReplies =
messageActions.indexOf(MESSAGE_ACTIONS.reply) > -1 &&
displayReplies &&
!threadList &&
channelConfig &&
channelConfig.replies;

console.log(messageActions);
if (
!message ||
message.type === 'error' ||
Expand Down
2 changes: 1 addition & 1 deletion src/components/Message/__tests__/MessageCommerce.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function renderMessageCommerce(
>
<MessageCommerce
message={message}
getMessageActions={() => ['flag', 'mute']}
getMessageActions={() => ['flag', 'mute', 'react', 'reply']}
{...props}
/>
</ChannelContext.Provider>,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Message/__tests__/MessageOptions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from 'mock-builders';
import { ChannelContext } from '../../../context';
import { MessageActions as MessageActionsMock } from '../../MessageActions';
import { MESSAGE_ACTIONS } from '../utils';
import MessageOptions from '../MessageOptions';

jest.mock('../../MessageActions', () => ({
Expand All @@ -22,6 +23,7 @@ const defaultProps = {
threadList: false,
messageWrapperRef: { current: document.createElement('div') },
onReactionListClick: () => {},
getMessageActions: () => Object.keys(MESSAGE_ACTIONS),
};

function generateAliceMessage(messageOptions) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Message/__tests__/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ describe('Message utils', () => {
canEdit: true,
canFlag: true,
canMute: true,
canReply: true,
canReact: true,
};
const actions = Object.values(MESSAGE_ACTIONS);

Expand Down

0 comments on commit f147f1e

Please sign in to comment.