Live location sharing: fix safari timestamps pt 2 (#8443)

* handle safari cocoa core data timestamps

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

* actually fix safari timestamp issue properly

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

* actually fix safari timestamp issue properly

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2022-04-29 11:12:28 +02:00 committed by GitHub
parent fddbc429a9
commit e233cf5061
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View file

@ -34,11 +34,16 @@ describe('geolocation utilities', () => {
let geolocation;
const defaultPosition = makeGeolocationPosition({});
// 14.03.2022 16:15
const now = 1647270879403;
beforeEach(() => {
geolocation = mockGeolocation();
jest.spyOn(Date, 'now').mockReturnValue(now);
});
afterEach(() => {
jest.spyOn(Date, 'now').mockRestore();
jest.spyOn(logger, 'error').mockRestore();
});
@ -136,7 +141,7 @@ describe('geolocation utilities', () => {
describe('mapGeolocationPositionToTimedGeo()', () => {
it('maps geolocation position correctly', () => {
expect(mapGeolocationPositionToTimedGeo(defaultPosition)).toEqual({
timestamp: 1647256791840, geoUri: 'geo:54.001927,-8.253491;u=1',
timestamp: now, geoUri: 'geo:54.001927,-8.253491;u=1',
});
});
});