feat(web): add geolocation utility (#20758)
* feat(geolocation): add geolocation utility * feat(web): geolocation utility - fix code review - 1 * feat(web): geolocation utility - fix code review - 2 * chore: cleanup * chore: feedback * feat(web): add animation and text animation on locations change and action text on thumbnail * styling, messages and filtering * selected color * format i18n * fix lint --------- Co-authored-by: Jason Rasmussen <jason@rasm.me> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { writable } from 'svelte/store';
|
||||
import { getAlbumDateRange, timeToSeconds } from './date-time';
|
||||
import { buildDateRangeFromYearMonthAndDay, getAlbumDateRange, timeToSeconds } from './date-time';
|
||||
|
||||
describe('converting time to seconds', () => {
|
||||
it('parses hh:mm:ss correctly', () => {
|
||||
@@ -75,3 +75,24 @@ describe('getAlbumDate', () => {
|
||||
expect(getAlbumDateRange({ startDate: '2021-01-01T00:00:00+05:00' })).toEqual('Jan 1, 2021');
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildDateRangeFromYearMonthAndDay', () => {
|
||||
it('should build correct date range for a specific day', () => {
|
||||
const result = buildDateRangeFromYearMonthAndDay(2023, 1, 8);
|
||||
|
||||
expect(result.from).toContain('2023-01-08T00:00:00');
|
||||
expect(result.to).toContain('2023-01-09T00:00:00');
|
||||
});
|
||||
|
||||
it('should build correct date range for a month', () => {
|
||||
const result = buildDateRangeFromYearMonthAndDay(2023, 2);
|
||||
expect(result.from).toContain('2023-02-01T00:00:00');
|
||||
expect(result.to).toContain('2023-03-01T00:00:00');
|
||||
});
|
||||
|
||||
it('should build correct date range for a year', () => {
|
||||
const result = buildDateRangeFromYearMonthAndDay(2023);
|
||||
expect(result.from).toContain('2023-01-01T00:00:00');
|
||||
expect(result.to).toContain('2024-01-01T00:00:00');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user