refactor: unify task and habit list rows
This commit is contained in:
@@ -32,8 +32,8 @@ async function expectTaskRowGeometry(row: Locator) {
|
||||
directChildrenInside,
|
||||
}
|
||||
})
|
||||
expect(metrics.height).toBeGreaterThanOrEqual(64)
|
||||
expect(metrics.height).toBeLessThanOrEqual(68)
|
||||
expect(metrics.height).toBeGreaterThanOrEqual(57)
|
||||
expect(metrics.height).toBeLessThanOrEqual(59)
|
||||
expect(metrics.scrollWidth).toBeLessThanOrEqual(metrics.clientWidth)
|
||||
expect(metrics.tailInside).toBe(true)
|
||||
expect(metrics.directChildrenInside).toBe(true)
|
||||
@@ -70,9 +70,14 @@ test('task rows keep approved rhythm without clipping across desktop and mobile'
|
||||
const dueTitle = `含截止日期-${suffix}`
|
||||
const parentTitle = `含子任务-${suffix}`
|
||||
const localDate = (offset: number) => {
|
||||
const date = new Date()
|
||||
date.setDate(date.getDate() + offset)
|
||||
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
|
||||
const shanghaiDate = new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'Asia/Shanghai', year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
}).format(new Date())
|
||||
const date = new Date(`${shanghaiDate}T12:00:00+08:00`)
|
||||
date.setUTCDate(date.getUTCDate() + offset)
|
||||
return new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'Asia/Shanghai', year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
}).format(date)
|
||||
}
|
||||
await create(ordinaryTitle)
|
||||
await create(completedTitle)
|
||||
|
||||
Reference in New Issue
Block a user