feat: 定时日报支持Windows

This commit is contained in:
电摇小子
2026-09-01 11:36:15 +08:00
parent f65dc4ac32
commit 25b72c3d76
15 changed files with 205 additions and 41 deletions
@@ -136,7 +136,7 @@ describe('ScheduledReportApiService', () => {
}
)
it('enforces the macOS platform gate even if a provider reports ready', async () => {
it('allows Windows when the image send capability is ready', async () => {
const { service } = makeApi()
const api = new ScheduledReportApiService({
service,
@@ -145,6 +145,23 @@ describe('ScheduledReportApiService', () => {
isDatabaseReady: () => true,
platform: 'win32'
})
const created = await api.create({
group: '技术交流群',
schedule: { type: 'daily', time: '09:00' }
})
expect(created.group).toMatchObject({ talker: 'tech@chatroom' })
expect(service.createTask).toHaveBeenCalledOnce()
})
it('keeps unsupported platforms blocked even if a provider reports ready', async () => {
const { service } = makeApi()
const api = new ScheduledReportApiService({
service,
getCapability: async () => capability('ready'),
listContacts: () => contacts,
isDatabaseReady: () => true,
platform: 'linux'
})
await expect(
api.create({ group: '技术交流群', schedule: { type: 'daily', time: '09:00' } })
).rejects.toMatchObject({ code: 'wechat_not_ready', status: 409 })