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:
parent
fddbc429a9
commit
e233cf5061
3 changed files with 11 additions and 7 deletions
|
@ -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',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue