feat: mac发送完整支持4.1.13以上版本, 完善授权

This commit is contained in:
Wxw-Gu committed 2026-11-04 15:49:15 +08:00
1 parent 9db08dba1a
commit 8c162969ff
18 files changed
+1841 -238

No files matched your search

@@ -58,7 +58,25 @@ describe('PersonalWechatSendPage on macOS', () => {
value: {
getPersonalWechatSendCapability: getCapability,
getPersonalWechatSenderStatus: getSenderStatus,
rebindPersonalWechatSender: rebindSender
rebindPersonalWechatSender: rebindSender,
// 发送能力授权卡所需的两个入口。页面在 Native 档位会调用它们,
// 缺 mock 会让 refresh 抛错、整页停在错误态。
getMacSendRuntimeAvailability: vi.fn(async () => ({
state: 'available',
message: '微信发送组件可用'
})),
getMacLicenseStatus: vi.fn(async () => ({
deviceId: null,
state: 'unlicensed',
authorized: false,
source: 'none',
features: [],
lastCheckedAt: null,
licenseExpiresAt: null,
tokenExpiresAt: null,
message: '当前设备暂无发送能力授权'
})),
refreshMacLicense: vi.fn()
}
})
})
@@ -66,7 +84,9 @@ describe('PersonalWechatSendPage on macOS', () => {
it('shows the native runtime readiness', async () => {
render(<PersonalWechatSendPage onNotice={vi.fn()} />)
expect(await screen.findByText('微信消息发送已配置完成')).toBeVisible()
// 页面重构后「就绪」的落点从 SetupGuide 尾部文案变成了「微信发送环境」卡片的状态标签;
// 断言改到新位置,语义仍是“运行时准备好了”。
expect(await screen.findByText('运行环境已就绪')).toBeVisible()
expect(screen.getAllByText('已就绪')).not.toHaveLength(0)
expect(screen.queryByText('查看支持的微信版本')).not.toBeInTheDocument()
expect(screen.queryByText('高级诊断')).not.toBeInTheDocument()