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