fix: harden countdown validation and recurrence
This commit is contained in:
@@ -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"')
|
||||
|
||||
Reference in New Issue
Block a user