From c338f8bf1f83e626df468c161392e4ec3c5c58e4 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 31 Jul 2019 11:17:24 +0100 Subject: [PATCH] Add `room` context to test --- src/components/views/messages/MessageActionBar.js | 6 ++---- test/components/structures/MessagePanel-test.js | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/views/messages/MessageActionBar.js b/src/components/views/messages/MessageActionBar.js index fb3c53c9f07..8db268076cf 100644 --- a/src/components/views/messages/MessageActionBar.js +++ b/src/components/views/messages/MessageActionBar.js @@ -145,12 +145,10 @@ export default class MessageActionBar extends React.PureComponent { let editButton; if (isContentActionable(this.props.mxEvent)) { - // `context` can be null in tests that use a subtree of components - // that don't create the context. - if (!this.context || !this.context.room || this.context.room.canReact) { + if (this.context.room.canReact) { reactButton = this.renderReactButton(); } - if (!this.context || !this.context.room || this.context.room.canReply) { + if (this.context.room.canReply) { replyButton =