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

+34
View File
@@ -0,0 +1,34 @@
import { describe, expect, it } from 'vitest'
import { desktopCanvasDisplaySize, resolutionFromPane } from '../../src/utils/desktopResolution'
describe('desktopCanvasDisplaySize', () => {
it('lets RDP fill a taller pane instead of letterboxing 1280×800', () => {
expect(desktopCanvasDisplaySize('rdp', 1100, 980, 1280, 800)).toEqual({
width: 1100,
height: 980,
})
})
it('keeps VNC aspect ratio so the framebuffer is not stretched', () => {
expect(desktopCanvasDisplaySize('vnc', 1100, 980, 1280, 800)).toEqual({
width: 1100,
height: 687,
})
})
})
describe('resolutionFromPane', () => {
it('uses the pane when it is large enough for a desktop session', () => {
expect(resolutionFromPane(1420, 900, { width: 1280, height: 800 })).toEqual({
width: 1420,
height: 900,
})
})
it('falls back when the pane is still collapsing or hidden', () => {
expect(resolutionFromPane(0, 0, { width: 1280, height: 800 })).toEqual({
width: 1280,
height: 800,
})
})
})