Live location share - set time limit (#8082)

* add mocking helpers for platform peg

Signed-off-by: Kerry Archibald <kerrya@element.io>

* basic working live duration dropdown

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add duration format utility

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add duration dropdown to live location picker

Signed-off-by: Kerry Archibald <kerrya@element.io>

* adjust style to allow overflow and variable height chin

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tidy comments

Signed-off-by: Kerry Archibald <kerrya@element.io>

* arrow fn change

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2022-03-21 12:42:58 +01:00 committed by GitHub
parent 8418b4fd71
commit 14653d1378
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 366 additions and 37 deletions

View file

@ -33,6 +33,7 @@ import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
import { LocationShareType } from '../../../../src/components/views/location/shareLocation';
import { findByTagAndTestId, flushPromises } from '../../../test-utils';
import Modal from '../../../../src/Modal';
import { DEFAULT_DURATION_MS } from '../../../../src/components/views/location/LiveDurationDropdown';
jest.mock('../../../../src/components/views/location/findMapStyleUrl', () => ({
findMapStyleUrl: jest.fn().mockReturnValue('test'),
@ -316,7 +317,7 @@ describe('<LocationShareMenu />', () => {
expect(eventContent).toEqual(expect.objectContaining({
[M_BEACON_INFO.name]: {
// default timeout
timeout: 300000,
timeout: DEFAULT_DURATION_MS,
description: `Ernie's live location`,
live: true,
},