fix: widen Today on desktop
ci / gitleaks (push) Successful in 8s
ci / docker (push) Successful in 3m41s

This commit is contained in:
2026-09-18 09:18:15 +08:00
parent 4d5d1f46e0
commit 28698a47b7
3 changed files with 10 additions and 8 deletions
+7 -7
View File
@@ -1,7 +1,7 @@
import type { APIRequestContext } from '@playwright/test'
import { expect, test } from './fixtures'
const widths = [721, 720, 390, 375]
const widths = [1440, 721, 720, 390, 375]
async function csrf(request: APIRequestContext) {
const state = await request.storageState()
@@ -50,8 +50,8 @@ test('Today plain-list layout matches the approved responsive geometry', async (
}
})).toEqual({
media720: width <= 720,
contentWidth: width === 721 ? 630 : width - 58,
environmentHeight: width === 721 ? 55 : width === 375 ? 90 : 93,
contentWidth: width >= 1440 ? 900 : width === 721 ? 630 : width - 58,
environmentHeight: width >= 721 ? 55 : width === 375 ? 90 : 93,
})
await expect(taskRowLocator).toHaveCount(1)
await expect(habitRowLocator).toHaveCount(1)
@@ -188,9 +188,9 @@ test('Today plain-list layout matches the approved responsive geometry', async (
expect(metrics.styles.filterBorderRadius).toBe('0px')
expect(metrics.styles.fabShadow).toContain('8px 18px')
expect(metrics.styles.fabIconWidth).toBeCloseTo(30, 0)
if (width === 721) {
if (width >= 721) {
expect(metrics.uniqueRows).toHaveLength(1)
expect(metrics.content.width).toBeCloseTo(630, 0)
expect(metrics.content.width).toBeCloseTo(width >= 1440 ? 900 : 630, 0)
expect(metrics.environment.height).toBeLessThanOrEqual(72)
expect(metrics.styles.titleFontSize).toBe('34px')
} else {
@@ -207,8 +207,8 @@ test('Today plain-list layout matches the approved responsive geometry', async (
}
}
if (width >= 721) {
expect(metrics.content.width).toBeLessThanOrEqual(721)
expect(Math.abs(metrics.content.left - (width - metrics.content.width) / 2)).toBeLessThanOrEqual(2)
expect(metrics.content.width).toBeLessThanOrEqual(width >= 1440 ? 900 : 721)
expect(Math.abs(metrics.content.left - (metrics.main.left + (metrics.main.width - metrics.content.width) / 2))).toBeLessThanOrEqual(2)
}
}
})