fix: 更新系统信息空值模拟数据以准确测试指纹生成逻辑
- 更新系统信息空值的模拟数据以更准确地测试指纹生成逻辑
This commit is contained in:
@@ -113,10 +113,23 @@ describe('fingerprint', () => {
|
||||
|
||||
it('should handle empty system information gracefully', async () => {
|
||||
// Mock empty responses
|
||||
mockSystemInfo.uuid.mockImplementationOnce(() => Promise.resolve({}))
|
||||
mockSystemInfo.baseboard.mockImplementationOnce(() => Promise.resolve({}))
|
||||
mockSystemInfo.bios.mockImplementationOnce(() => Promise.resolve({}))
|
||||
mockSystemInfo.system.mockImplementationOnce(() => Promise.resolve({}))
|
||||
mockSystemInfo.uuid.mockImplementationOnce(() =>
|
||||
Promise.resolve({ os: '', hardware: '' }),
|
||||
)
|
||||
mockSystemInfo.baseboard.mockImplementationOnce(() =>
|
||||
Promise.resolve({
|
||||
manufacturer: '',
|
||||
model: '',
|
||||
version: '',
|
||||
serial: '',
|
||||
}),
|
||||
)
|
||||
mockSystemInfo.bios.mockImplementationOnce(() =>
|
||||
Promise.resolve({ vendor: '', version: '', releaseDate: '' }),
|
||||
)
|
||||
mockSystemInfo.system.mockImplementationOnce(() =>
|
||||
Promise.resolve({ manufacturer: '', model: '', version: '', sku: '' }),
|
||||
)
|
||||
mockSystemInfo.diskLayout.mockImplementationOnce(() =>
|
||||
Promise.resolve([]),
|
||||
)
|
||||
@@ -134,6 +147,9 @@ describe('fingerprint', () => {
|
||||
mockSystemInfo.baseboard.mockImplementationOnce(() =>
|
||||
Promise.resolve({
|
||||
manufacturer: 'Only Manufacturer',
|
||||
model: '',
|
||||
version: '',
|
||||
serial: '',
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user