:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(lemon-ui): remove step narration from calendar select tests (#113663)
posthog[bot]5cf4b56b3f7d
diff --git a/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.test.tsx b/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.test.tsxindex fe7fe7dff3fd..c3e22dd6b975 100644--- a/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.test.tsx+++ b/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.test.tsx@@ -83,18 +83,14 @@ describe('LemonCalendarSelect', () => {test('select various dates', async () => {const { container, onClose, onChange, clickOnDate } = renderLemonCalendarSelect(dayjs('2022-02-10'))- // find just one monthconst calendar = getByDataAttr(container, 'lemon-calendar')expect(calendar).toBeTruthy()- // find February 2022expect(await within(calendar).findByText('February 2022')).toBeTruthy()- // click on 15await clickOnDate('15')expect(onChange).toHaveBeenCalledWith(dayjs('2022-02-15'))- // click on 27await clickOnDate('27')expect(onChange).toHaveBeenCalledWith(dayjs('2022-02-27'))@@ -107,22 +103,18 @@ describe('LemonCalendarSelect', () => {granularity: 'minute',})- // click on hour 8await clickOnDate('15')// sets the date to 15, hour and minutes to current time, and seconds to 0expect(onChange).toHaveBeenCalledWith(dayjs('2023-01-15T17:22:00.000Z'))- // click on minute 42await clickOnTime({ unit: 'm', value: 42 })// sets the minutes but leaves all other values unchangedexpect(onChange).toHaveBeenCalledWith(dayjs('2023-01-15T17:42:00.000Z'))- // click on 'am'await clickOnTime({ unit: 'a', value: 'am' })// subtracts 12 hours from the timeexpect(onChange).toHaveBeenCalledWith(dayjs('2023-01-15T05:42:00.000Z'))- // click on hour 8await clickOnTime({ unit: 'h', value: 8 })// only changes the hourexpect(onChange).toHaveBeenCalledWith(dayjs('2023-01-15T08:42:00.000Z'))@@ -134,27 +126,22 @@ describe('LemonCalendarSelect', () => {selectionPeriod: 'upcoming',})- // click on minuteawait clickOnTime({ unit: 'm', value: 42 })// time is disabled until a date is clickedexpect(onChange).not.toHaveBeenCalled()- // click on past dateawait clickOnDate('9')// cannot select a date in the pastexpect(onChange).not.toHaveBeenCalled()- // click on current dateawait clickOnDate('10')// chooses the current date and sets the time to the current hour and minuteexpect(onChange).toHaveBeenCalledWith(dayjs('2023-01-10T17:22:00.000Z'))- // click on an earlier hourawait clickOnTime({ unit: 'a', value: 'am' })// does not update the date because it is in the pastexpect(onChange).toHaveBeenLastCalledWith(dayjs('2023-01-10T17:22:00.000Z'))- // click on a later hourawait clickOnTime({ unit: 'h', value: '8' })// updates the hour to 8pm (later than 5pm)expect(onChange).toHaveBeenLastCalledWith(dayjs('2023-01-10T20:22:00.000Z'))@@ -213,27 +200,22 @@ describe('LemonCalendarSelect', () => {selectionPeriod: 'past',})- // click on minuteawait clickOnTime({ unit: 'm', value: 12 })// time is disabled until a date is clickedexpect(onChange).not.toHaveBeenCalled()- // click on future dateawait clickOnDate('11')// cannot select a date in the futureexpect(onChange).not.toHaveBeenCalled()- // click on current dateawait clickOnDate('10')// chooses the current date and sets the time to the current hour and minuteexpect(onChange).toHaveBeenCalledWith(dayjs('2023-01-10T17:22:00.000Z'))- // click on an later hourawait clickOnTime({ unit: 'h', value: '18' })// does not update the date because it is in the futureexpect(onChange).toHaveBeenLastCalledWith(dayjs('2023-01-10T17:22:00.000Z'))- // click on an earlier hourawait clickOnTime({ unit: 'h', value: '2' })// updates the hour to 2pm (earlier than 5pm)expect(onChange).toHaveBeenLastCalledWith(dayjs('2023-01-10T14:22:00.000Z'))@@ -245,7 +227,6 @@ describe('LemonCalendarSelect', () => {use24HourFormat: true,})- // click on a date firstawait clickOnDate('15')// sets the date to 15, hour and minutes to current time, and seconds to 0expect(onChange).toHaveBeenCalledWith(dayjs('2023-01-15T17:22:00.000Z'))@@ -262,7 +243,6 @@ describe('LemonCalendarSelect', () => {await clickOnTime({ unit: 'h', value: 0 })expect(onChange).toHaveBeenCalledWith(dayjs('2023-01-15T00:22:00.000Z'))- // click on minute 45await clickOnTime({ unit: 'm', value: 45 })expect(onChange).toHaveBeenCalledWith(dayjs('2023-01-15T00:45:00.000Z'))})