fix: harden countdown validation and recurrence
ci / gitleaks (push) Successful in 7s
ci / docker (push) Successful in 3m23s

This commit is contained in:
2026-09-09 12:40:40 +08:00
parent e163f6f368
commit 489d120159
4 changed files with 288 additions and 40 deletions
+16
View File
@@ -52,6 +52,22 @@ describe('countdown modal accessibility', () => {
expect(source).not.toContain("Promise.all([request('/countdowns'),request('/countdowns?archived=true')])")
})
it('prevents duplicate submits and sends the edit precondition', () => {
expect(source).toContain('if (busy.value) return')
expect(source).toContain('payload.expected_updated_at=editingItem.value?.updated_at')
expect(source).toContain(':disabled="busy"')
})
it('keeps weekly and monthly recurrence available for lunar dates', () => {
expect(source).toContain('<option value="weekly">每周</option>')
expect(source).toContain('<option value="monthly">每月</option>')
})
it('does not repeat the lunar label in the converted date line', () => {
expect(source).toContain("return `${formatDate(item.display_date)}${suffix}`")
expect(source).not.toContain("`${formatDate(item.display_date)} · ${item.lunar_text}${suffix}`")
})
it('keeps the empty state directly actionable', () => {
expect(source).toContain('添加第一个重要日子')
expect(source).toContain('@click="openFromEmpty"')