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
Miguel Raposo 2026-05-29 11:04:43 +01:00
parent 344d1cd1dd
commit d7b1019308
5 changed files with 7 additions and 7 deletions

View File

@ -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[];

View File

@ -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

View File

@ -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