refactor(web): cleaner code and better names for the tests
Co-authored-by: Afonso Mendonça Ribeiro <afonso.mendonca.ribeiro@tecnico.ulisboa.pt>pull/28676/head
parent
344d1cd1dd
commit
d7b1019308
|
|
@ -51,7 +51,7 @@
|
|||
import { t } from 'svelte-i18n';
|
||||
import { GeoJSON, HeatmapLayer, MapLibre, MarkerLayer, Popup } from 'svelte-maplibre';
|
||||
import type { SelectionBBox } from './types';
|
||||
import { autoZoomCluster } from './map-utils';
|
||||
import { autoZoomCluster } from './utils';
|
||||
|
||||
interface Props {
|
||||
mapMarkers?: MapMarkerResponseDto[];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type { Feature, Point } from 'geojson';
|
|||
import type { GeoJSONSource, Map } from 'maplibre-gl';
|
||||
import type { Mock } from 'vitest';
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { autoZoomCluster } from '../map-utils';
|
||||
import { autoZoomCluster } from '../utils';
|
||||
|
||||
/**
|
||||
* Unit tests for the autoZoomCluster function
|
||||
|
|
@ -190,17 +190,17 @@ export class TimelineMonth {
|
|||
isVideo: !(bucketAssets.isImage?.[i] ?? true),
|
||||
livePhotoVideoId: bucketAssets.livePhotoVideoId?.[i] ?? null,
|
||||
localDateTime,
|
||||
createdAt: fromISODateTimeUTC(bucketAssets.createdAt[i]).setZone('local'),
|
||||
createdAt: fromISODateTimeUTC(bucketAssets.createdAt?.[i] ?? bucketAssets.fileCreatedAt[i]).setZone('local'),
|
||||
fileCreatedAt,
|
||||
ownerId: bucketAssets.ownerId?.[i] ?? '',
|
||||
projectionType: bucketAssets.projectionType?.[i] ?? null,
|
||||
ratio: bucketAssets.ratio?.[i] ?? 1,
|
||||
stack: bucketAssets.stack?.[i]
|
||||
? {
|
||||
id: bucketAssets.stack[i]![0],
|
||||
primaryAssetId: bucketAssets.id[i],
|
||||
assetCount: Number.parseInt(bucketAssets.stack[i]![1]),
|
||||
}
|
||||
id: bucketAssets.stack[i]![0],
|
||||
primaryAssetId: bucketAssets.id[i],
|
||||
assetCount: Number.parseInt(bucketAssets.stack[i]![1]),
|
||||
}
|
||||
: null,
|
||||
thumbhash: bucketAssets.thumbhash?.[i] ?? null,
|
||||
people: null, // People are not included in the bucket assets
|
||||
|
|
|
|||
Loading…
Reference in New Issue