@@ -16,12 +16,13 @@ limitations under the License.
1616
1717import React from 'react' ;
1818import { mount , ReactWrapper } from 'enzyme' ;
19+ import { mocked } from 'jest-mock' ;
1920import { RoomMember } from 'matrix-js-sdk/src/models/room-member' ;
2021import { MatrixClient } from 'matrix-js-sdk/src/client' ;
21- import { mocked } from 'jest-mock' ;
22- import { act } from 'react-dom/test-utils' ;
23- import { M_ASSET , LocationAssetType } from 'matrix-js-sdk/src/@types/location' ;
22+ import { RelationType } from 'matrix-js-sdk/src/matrix' ;
2423import { logger } from 'matrix-js-sdk/src/logger' ;
24+ import { M_ASSET , LocationAssetType } from 'matrix-js-sdk/src/@types/location' ;
25+ import { act } from 'react-dom/test-utils' ;
2526
2627import LocationShareMenu from '../../../../src/components/views/location/LocationShareMenu' ;
2728import MatrixClientContext from '../../../../src/contexts/MatrixClientContext' ;
@@ -375,6 +376,16 @@ describe('<LocationShareMenu />', () => {
375376 describe ( 'Live location share' , ( ) => {
376377 beforeEach ( ( ) => enableSettings ( [ "feature_location_share_live" ] ) ) ;
377378
379+ it ( 'does not display live location share option when composer has a relation' , ( ) => {
380+ const relation = {
381+ rel_type : RelationType . Thread ,
382+ event_id : '12345' ,
383+ } ;
384+ const component = getComponent ( { relation } ) ;
385+
386+ expect ( getShareTypeOption ( component , LocationShareType . Live ) . length ) . toBeFalsy ( ) ;
387+ } ) ;
388+
378389 it ( 'creates beacon info event on submission' , ( ) => {
379390 const onFinished = jest . fn ( ) ;
380391 const component = getComponent ( { onFinished } ) ;
0 commit comments