GuDingZiChan/backend/src/services/__tests__/dingtalkDeliveryService.notification-center.test.ts

15 lines
697 B
TypeScript

import test from 'node:test'
import assert from 'node:assert/strict'
import { resolveNotificationCenterLocalStatus } from '../dingtalkDeliveryService'
test('通知中心未完成状态在本地保持发送中而不是误记为已发送', () => {
for (const status of ['pending', 'processing', 'sending', 'retrying'] as const) {
assert.equal(resolveNotificationCenterLocalStatus(status), 'sending')
}
assert.equal(resolveNotificationCenterLocalStatus('sent'), 'sent')
assert.equal(resolveNotificationCenterLocalStatus('unread'), 'unread')
assert.equal(resolveNotificationCenterLocalStatus('read'), 'read')
assert.equal(resolveNotificationCenterLocalStatus('failed'), 'failed')
})