diff --git a/app/ide-desktop/lib/dashboard/src/authentication/src/__tests__/assetQuery.test.ts b/app/ide-desktop/lib/dashboard/src/authentication/src/__tests__/assetQuery.test.ts index c81e0ce35e0a..1ca3234d8023 100644 --- a/app/ide-desktop/lib/dashboard/src/authentication/src/__tests__/assetQuery.test.ts +++ b/app/ide-desktop/lib/dashboard/src/authentication/src/__tests__/assetQuery.test.ts @@ -5,12 +5,12 @@ import * as assetQuery from '../assetQuery' v.test.each([ { query: '' }, - { query: 'name:' }, - { query: '-name:' }, - { query: 'label:' }, - { query: '-label:' }, - { query: 'owner:' }, - { query: '-owner:' }, + { query: 'name:', names: [[]] }, + { query: '-name:', negativeNames: [[]] }, + { query: 'label:', labels: [[]] }, + { query: '-label:', negativeLabels: [[]] }, + { query: 'owner:', owners: [[]] }, + { query: '-owner:', negativeOwners: [[]] }, { query: '"', keywords: [['']] }, { query: '""', keywords: [['']] }, { query: 'a', keywords: [['a']] }, diff --git a/app/ide-desktop/lib/dashboard/src/authentication/src/dashboard/__tests__/dateTime.test.ts b/app/ide-desktop/lib/dashboard/src/authentication/src/dashboard/__tests__/dateTime.test.ts index e60a2dc77cec..3970a92688cf 100644 --- a/app/ide-desktop/lib/dashboard/src/authentication/src/dashboard/__tests__/dateTime.test.ts +++ b/app/ide-desktop/lib/dashboard/src/authentication/src/dashboard/__tests__/dateTime.test.ts @@ -9,19 +9,30 @@ import * as dateTime from '../dateTime' /* eslint-disable @typescript-eslint/no-magic-numbers */ +/** The number of milliseconds in an hour. */ +const HOUR_MS = 3_600_000 /** The number of minutes in an hour. */ const HOUR_MIN = 60 +const TIMEZONE_OFFSET_MINS = new Date().getTimezoneOffset() /** The offset of local time */ -const TIMEZONE_OFFSET_HOURS = new Date().getTimezoneOffset() / HOUR_MIN +const TIMEZONE_OFFSET_HOURS = Math.floor(TIMEZONE_OFFSET_MINS / HOUR_MIN) v.test.each([ - { date: new Date(0), string: '1970-01-01T00:00:00.000Z', chatString: '01/01/1970 10:00 AM' }, + { date: new Date(0), string: '1970-01-01T00:00:00.000Z' }, { date: new Date(2001, 1, 3, -TIMEZONE_OFFSET_HOURS), string: '2001-02-03T00:00:00.000Z', - chatString: '03/02/2001 10:00 AM', }, -])('Date and time serialization', ({ date, string, chatString }) => { +])('Date and time serialization', ({ date, string }) => { v.expect(dateTime.toRfc3339(date)).toBe(string) +}) + +v.test.each([ + { date: new Date(TIMEZONE_OFFSET_HOURS * HOUR_MS), chatString: `01/01/1970 00:00 AM` }, + { + date: new Date(2001, 1, 3), + chatString: `03/02/2001 00:00 AM`, + }, +])('Date and time serialization', ({ date, chatString }) => { v.expect(dateTime.formatDateTimeChatFriendly(date)).toBe(chatString) })