diff --git a/src/components/views/messages/EncryptionEvent.tsx b/src/components/views/messages/EncryptionEvent.tsx index 7416cc3c9a..3af9c463c9 100644 --- a/src/components/views/messages/EncryptionEvent.tsx +++ b/src/components/views/messages/EncryptionEvent.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, {useContext} from 'react'; +import React, {forwardRef, useContext} from 'react'; import {MatrixEvent} from "matrix-js-sdk/src/models/event"; import { _t } from '../../../languageHandler'; @@ -27,7 +27,7 @@ interface IProps { mxEvent: MatrixEvent; } -const EncryptionEvent: React.FC = ({mxEvent}) => { +const EncryptionEvent = forwardRef(({mxEvent}, ref) => { const cli = useContext(MatrixClientContext); const roomId = mxEvent.getRoomId(); const isRoomEncrypted = MatrixClientPeg.get().isRoomEncrypted(roomId); @@ -61,7 +61,8 @@ const EncryptionEvent: React.FC = ({mxEvent}) => { className="mx_cryptoEvent mx_cryptoEvent_icon mx_cryptoEvent_icon_warning" title={_t("Encryption not enabled")} subtitle={_t("The encryption used by this room isn't supported.")} + ref={ref} />; -} +}); export default EncryptionEvent; diff --git a/src/components/views/messages/EventTileBubble.tsx b/src/components/views/messages/EventTileBubble.tsx index 8a2cf0f01c..f797a97a3d 100644 --- a/src/components/views/messages/EventTileBubble.tsx +++ b/src/components/views/messages/EventTileBubble.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, {ReactNode} from "react"; +import React, {forwardRef, ReactNode} from "react"; import classNames from "classnames"; interface IProps { @@ -23,12 +23,12 @@ interface IProps { subtitle?: ReactNode; } -const EventTileBubble: React.FC = ({ className, title, subtitle, children }) => { - return
+const EventTileBubble = forwardRef(({ className, title, subtitle, children }, ref) => { + return
{ title }
{ subtitle &&
{ subtitle }
} { children }
; -}; +}); export default EventTileBubble; diff --git a/src/contexts/RoomContext.ts b/src/contexts/RoomContext.ts index e8eb0c23b4..082dcc4e6b 100644 --- a/src/contexts/RoomContext.ts +++ b/src/contexts/RoomContext.ts @@ -29,7 +29,6 @@ const RoomContext = createContext({ guestsCanJoin: false, canPeek: false, showApps: false, - isAlone: false, isPeeking: false, showingPinned: false, showReadReceipts: true, diff --git a/test/components/structures/MessagePanel-test.js b/test/components/structures/MessagePanel-test.js index 235ae94010..0bcdfcd5e5 100644 --- a/test/components/structures/MessagePanel-test.js +++ b/test/components/structures/MessagePanel-test.js @@ -38,6 +38,7 @@ import { configure, mount } from "enzyme"; import Velocity from 'velocity-animate'; import MatrixClientContext from "../../../src/contexts/MatrixClientContext"; import RoomContext from "../../../src/contexts/RoomContext"; +import DMRoomMap from "../../../src/utils/DMRoomMap"; configure({ adapter: new Adapter() }); @@ -79,6 +80,8 @@ describe('MessagePanel', function() { // complete without this even if we mock the clock and tick it // what should be the correct amount of time). Velocity.mock = true; + + DMRoomMap.makeShared(); }); afterEach(function() { diff --git a/test/test-utils.js b/test/test-utils.js index d006eee823..c8e623b1d9 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -242,6 +242,7 @@ export function mkStubRoom(roomId = null) { setBlacklistUnverifiedDevices: jest.fn(), on: jest.fn(), removeListener: jest.fn(), + getDMInviter: jest.fn(), }; }