chore: 保存工作副本——客户端授权新契约(双端点/验签/令牌/周检)与桌面会话可靠性改进
This commit is contained in:
1 parent
f71eef0eba
commit
ae6093c9b3
163 files changed
+4911
-2494
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
BUG_REPORT_ISSUE_URL,
|
||||
buildBugReportUrl,
|
||||
formatRuntimeSystem,
|
||||
githubBugPlatform,
|
||||
} from '../../src/utils/bugReport'
|
||||
|
||||
describe('bugReport', () => {
|
||||
it('maps rust OS names onto the GitHub form dropdown', () => {
|
||||
expect(githubBugPlatform('macos')).toBe('macOS')
|
||||
expect(githubBugPlatform('windows')).toBe('Windows')
|
||||
expect(githubBugPlatform('linux')).toBe('Linux')
|
||||
expect(githubBugPlatform('freebsd')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('formats the About system line for people, not rust consts', () => {
|
||||
expect(formatRuntimeSystem('macos', 'aarch64')).toBe('macOS · aarch64')
|
||||
expect(formatRuntimeSystem('windows', 'x86_64')).toBe('Windows · x86_64')
|
||||
})
|
||||
|
||||
it('pre-fills the issue form the way Settings → About should', () => {
|
||||
const url = buildBugReportUrl({
|
||||
appVersion: '2.1.1',
|
||||
os: 'macos',
|
||||
arch: 'aarch64',
|
||||
logPath: '/tmp/opsxshell.log',
|
||||
userAgent: 'Mozilla/5.0 Test',
|
||||
})
|
||||
|
||||
const parsed = new URL(url)
|
||||
expect(`${parsed.origin}${parsed.pathname}`).toBe(BUG_REPORT_ISSUE_URL)
|
||||
expect(parsed.searchParams.get('template')).toBe('bug_report.yml')
|
||||
expect(parsed.searchParams.get('title')).toBe('[Bug] ')
|
||||
expect(parsed.searchParams.get('platform')).toBe('macOS')
|
||||
expect(parsed.searchParams.get('version')).toBe('2.1.1')
|
||||
expect(parsed.searchParams.get('install_source')).toBeNull()
|
||||
expect(parsed.searchParams.get('logs')).toContain('Reported from OpsXShell Settings (opsxshell 2.1.1).')
|
||||
expect(parsed.searchParams.get('logs')).toContain('OS: macos aarch64')
|
||||
expect(parsed.searchParams.get('logs')).toContain('Log file: /tmp/opsxshell.log')
|
||||
expect(parsed.searchParams.get('logs')).not.toContain('Tauri')
|
||||
expect(parsed.searchParams.get('logs')).not.toContain('libssh2')
|
||||
expect(parsed.searchParams.get('logs')).not.toContain('password')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user