v4.0.18版本提交

This commit is contained in:
2026-09-08 10:07:34 +08:00
parent 4bdb09068c
commit 23ba639e9b
46 changed files with 1922 additions and 162 deletions
+15
View File
@@ -1,6 +1,8 @@
import { describe, expect, it } from 'vitest';
import {
formatWecomReportMarkdown,
WECOM_REPORT_EXCLUDED_ORDER_STATUSES,
wecomReportCountedOrderWhere,
wecomReportCutoff,
wecomReportDueAt,
wecomReportPeriod,
@@ -24,6 +26,19 @@ const emptyStats = {
redeemAmountIncrement: 40,
};
describe('wecomReportCountedOrderWhere', () => {
it('excludes pending pay, cancelled and refunding', () => {
expect([...WECOM_REPORT_EXCLUDED_ORDER_STATUSES]).toEqual([
'PENDING_PAY',
'CANCELLED',
'REFUNDING',
]);
expect(wecomReportCountedOrderWhere()).toEqual({
status: { notIn: ['PENDING_PAY', 'CANCELLED', 'REFUNDING'] },
});
});
});
describe('wecomReportPeriod', () => {
it('daily is the previous Shanghai calendar day (closed at send-day 00:00)', () => {
const p = wecomReportPeriod('daily', new Date('2026-09-02T20:00:00+08:00'));