Archived
mail domain:发信校验与选账号(from 不静默回落)、分发状态机、账号记录与视图(密文进不了视图)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TM4kUBvekALu9qqmp7D3wr
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/** 分发状态机:dispatching 不能被重投;回调回 skipped 就是 skipped */
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { canRedeliver, stateOfOutcome } from '../internal/domain/delivery.ts';
|
||||
|
||||
describe('delivery', () => {
|
||||
it('从没投过 / done / failed / skipped 都能重投;正在投的不能', () => {
|
||||
expect(canRedeliver(undefined)).toBe(true);
|
||||
expect(canRedeliver('done')).toBe(true);
|
||||
expect(canRedeliver('failed')).toBe(true);
|
||||
expect(canRedeliver('skipped')).toBe(true);
|
||||
expect(canRedeliver('dispatching')).toBe(false);
|
||||
});
|
||||
it('回调的返回值定状态', () => {
|
||||
expect(stateOfOutcome(undefined)).toBe('done');
|
||||
expect(stateOfOutcome({ skipped: '账号未绑定通道' })).toBe('skipped');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user