fix: Scheduled date picker always points to today, regardless of a previous date (#7329)

* fix: Scheduled date picker always points to today, regardless if a previous date was already set
fixes #6985

* fix: e2e-test flakyness for datepicker
pull/7325/merge
sallto 2022-11-15 03:36:01 +01:00 committed by GitHub
parent 3de6f3de96
commit e882b7cabd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -228,3 +228,22 @@ test('invalid page props #3944', async ({ page, block }) => {
// Force rendering property block
await block.enterNext()
})
test('Scheduled date picker should point to the already specified Date #6985', async({page,block})=>{
await createRandomPage(page)
await block.mustFill('testTask \n SCHEDULED: <2000-05-06 Sat>')
await block.enterNext()
await page.waitForTimeout(500)
await block.escapeEditing()
// Open date picker
await page.click('a.opacity-80')
await page.waitForTimeout(500)
expect(page.locator('text=May 2000')).toBeVisible()
expect(page.locator('td:has-text("6").active')).toBeVisible()
// Close date picker
await page.click('a.opacity-80')
await page.waitForTimeout(500)
})

View File

@ -136,7 +136,7 @@
(reset! *timestamp {:time ""
:repeater {}}))
(when-not (:date-picker/date @state/state)
(state/set-state! :date-picker/date (t/today))))
(state/set-state! :date-picker/date (get ts :date (t/today)))))
state)
:will-unmount (fn [state]
(clear-timestamp!)