mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-11-30 16:02:58 +08:00
feat: 发送支持群聊@成员
生命周期整理 清理残留整理 完善skill
This commit is contained in:
1 parent
804466aad8
commit
5d4ba73771
28 files changed
+1214
-103
No files matched your search
@@ -154,7 +154,7 @@ describe('PersonalWechatSendPage on macOS', () => {
|
||||
expect(cleanupResidualProcesses).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('cleans only the process the user confirmed and refreshes the runtime state', async () => {
|
||||
it('cleans the confirmed runtime host and automatically restarts it', async () => {
|
||||
const onNotice = vi.fn()
|
||||
render(<PersonalWechatSendPage onNotice={onNotice} />)
|
||||
|
||||
@@ -167,10 +167,22 @@ describe('PersonalWechatSendPage on macOS', () => {
|
||||
{ pid: 202, confirmationToken: 'process-identity-202' }
|
||||
])
|
||||
})
|
||||
expect(onNotice).toHaveBeenCalledWith('已结束 1 个残留进程;发送环境状态已刷新。')
|
||||
expect(await screen.findByRole('button', { name: '重新启动发送组件' })).toBeVisible()
|
||||
fireEvent.click(screen.getByRole('button', { name: '重新启动发送组件' }))
|
||||
await waitFor(() => expect(startMacRuntime).toHaveBeenCalledOnce())
|
||||
expect(onNotice).toHaveBeenCalledWith(
|
||||
'已清理并重启发送 Host;如刚才关闭了微信,请重新打开微信并绑定。'
|
||||
)
|
||||
})
|
||||
|
||||
it('uses the same cleanup button to start the runtime when no residual process exists', async () => {
|
||||
listResidualProcesses.mockResolvedValue([])
|
||||
const onNotice = vi.fn()
|
||||
render(<PersonalWechatSendPage onNotice={onNotice} />)
|
||||
|
||||
await screen.findByText('运行环境已就绪')
|
||||
fireEvent.click(screen.getByRole('button', { name: '清理残留以及微信进程' }))
|
||||
|
||||
await waitFor(() => expect(startMacRuntime).toHaveBeenCalledOnce())
|
||||
expect(screen.queryByRole('heading', { name: '清理微信残留进程?' })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('shows that WeChat must be reopened and rebound after its process is cleaned', async () => {
|
||||
@@ -216,6 +228,11 @@ describe('PersonalWechatSendPage on macOS', () => {
|
||||
canSendVoice: false
|
||||
}
|
||||
getSenderStatus.mockReset().mockResolvedValueOnce(senderStatus).mockResolvedValue(stoppedStatus)
|
||||
getCapability
|
||||
.mockReset()
|
||||
.mockResolvedValueOnce(capability)
|
||||
.mockResolvedValue({ ...capability, senderStatus: stoppedStatus })
|
||||
rebindSender.mockReset().mockResolvedValueOnce(stoppedStatus).mockResolvedValueOnce(senderStatus)
|
||||
getMacLicenseStatus.mockResolvedValue({
|
||||
deviceId: 'mac_test',
|
||||
state: 'valid',
|
||||
|
||||
@@ -97,6 +97,30 @@ describe('personal WeChat unavailable product state', () => {
|
||||
expect(screen.queryByText(/manifest|dylib|runtime missing|文件缺失/i)).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('shows a runtime startup failure instead of an endless checking message', () => {
|
||||
const failedRuntimeStatus: PersonalWechatSenderStatus = {
|
||||
...unavailableStatus,
|
||||
state: 'error',
|
||||
endpointReady: false,
|
||||
runtimeReady: false,
|
||||
message: '发送运行时启动失败(进程退出码 1)',
|
||||
error: '发送运行时启动失败(进程退出码 1)'
|
||||
}
|
||||
|
||||
render(
|
||||
<PersonalWechatSetupGuide
|
||||
senderStatus={failedRuntimeStatus}
|
||||
binding={false}
|
||||
detecting={false}
|
||||
sessionBound={false}
|
||||
showBindAction={false}
|
||||
/>
|
||||
)
|
||||
|
||||
expect(screen.getByRole('alert')).toHaveTextContent('发送运行时启动失败(进程退出码 1)')
|
||||
expect(screen.queryByText('正在检查 发送运行时…')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('describes a ready runtime separately from pending send capability initialization', () => {
|
||||
const boundStatus: PersonalWechatSenderStatus = {
|
||||
...unavailableStatus,
|
||||
|
||||
Reference in new issue
Block a user