feat: release OpsXShell 2.1.1
This commit is contained in:
1 parent
a3dba0c6ed
commit
494ef6b9d0
37 files changed
+2039
-370
No files matched your search
@@ -19,6 +19,32 @@ function deferred<T>() {
|
||||
}
|
||||
|
||||
describe('Tauri event subscriptions', () => {
|
||||
it('maps a shell close event without treating the pooled connection as closed', async () => {
|
||||
const unlisten = vi.fn()
|
||||
let dispatch: ((event: { payload: unknown }) => void) | undefined
|
||||
listenMock.mockImplementationOnce(async (_channel, callback) => {
|
||||
dispatch = callback
|
||||
return unlisten
|
||||
})
|
||||
const listener = vi.fn()
|
||||
|
||||
desktopApi.onShellClosed(listener)
|
||||
await Promise.resolve()
|
||||
dispatch?.({
|
||||
payload: {
|
||||
connectionId: 'connection-1',
|
||||
shellId: 'shell-2',
|
||||
reason: '远端 Shell 因空闲策略(TMOUT)自动退出',
|
||||
idleTimeout: true,
|
||||
},
|
||||
})
|
||||
|
||||
expect(listener).toHaveBeenCalledWith({}, 'connection-1', 'shell-2', {
|
||||
reason: '远端 Shell 因空闲策略(TMOUT)自动退出',
|
||||
idleTimeout: true,
|
||||
})
|
||||
})
|
||||
|
||||
it('safely unregisters when React cleans up before listen resolves', async () => {
|
||||
const pending = deferred<() => void>()
|
||||
const unlisten = vi.fn()
|
||||
|
||||
Reference in new issue
Block a user