chore: 保存工作副本——客户端授权新契约(双端点/验签/令牌/周检)与桌面会话可靠性改进

This commit is contained in:
Logan.Li committed 2026-09-14 22:10:22 +08:00
1 parent f71eef0eba
commit ae6093c9b3
163 files changed
+4911 -2494

No files matched your search

+4 -6
View File
@@ -61,6 +61,7 @@ describe('App foundation acceptance', () => {
fireEvent.doubleClick(titleBar!)
expect(mockDesktopApi.toggleMaximize).not.toHaveBeenCalled()
expect(document.querySelector('[data-app-overlay]')).toBeNull()
})
it('writes encrypted exported sessions to the selected backup file', async () => {
@@ -88,7 +89,7 @@ describe('App foundation acceptance', () => {
})
vi.mocked(mockDesktopApi.showSaveDialog).mockResolvedValueOnce({
canceled: false,
filePath: '/tmp/opsxshell-sessions.bak',
filePath: '/tmp/opsxshell-hosts.oxs',
})
render(<App />)
@@ -108,13 +109,10 @@ describe('App foundation acceptance', () => {
expect(mockDesktopApi.showSaveDialog).toHaveBeenCalledWith(
expect.objectContaining({
defaultPath: 'opsxshell-sessions.bak',
defaultPath: 'opsxshell-hosts.oxs',
})
)
expect(mockDesktopApi.writeFile).toHaveBeenCalledWith(
'/tmp/opsxshell-sessions.bak',
expect.any(String)
)
expect(mockDesktopApi.writeFile).toHaveBeenCalledWith('/tmp/opsxshell-hosts.oxs', expect.any(String))
const [, encoded] = vi.mocked(mockDesktopApi.writeFile).mock.calls[0]
const decoded = decodeBase64ToText(String(encoded))
expect(decoded).toContain('"format": "opsxshell-backup"')