refactor: unify task and habit list rows
ci / gitleaks (push) Successful in 10s
ci / docker (push) Successful in 3m45s

This commit is contained in:
2026-09-18 06:25:13 +08:00
parent e4e1d96b30
commit a4c1ac5978
8 changed files with 219 additions and 108 deletions
+10 -5
View File
@@ -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)