CN-1063 fix: 单元测试--实体详情流量折线图和底下3个tab

This commit is contained in:
刘洪洪
2023-06-07 10:34:01 +08:00
parent 73f72b3116
commit d2a3ee8cf9
9 changed files with 581 additions and 43 deletions

View File

@@ -0,0 +1,86 @@
const mockData = {
// 空
empty: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: []
}
}
},
bytes: {
// 边界
boundary: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: []
},
msg: 'OK'
}
}
},
// 正常数据
common: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: [
{
location: {
isp: 'dba Omsoft',
updateTime: 1685696510,
createTime: 1685696510,
isValid: 1
}
},
{
malware: {
threatType: 'command and control',
malwareName: 'IcedID',
malwareAlias: 'BokBot,IceID',
updateTime: 1685696510,
createTime: 1685696510,
isValid: 1
}
},
{
darkweb: {
nodeType: 'i2p',
updateTime: 1685696510,
createTime: 1685696510,
isValid: 1
}
},
{
userDefinedTag: {
id: 1,
tagValue: '门户网站',
updateTime: 1685696500,
createTime: 1685696500,
isValid: 1
}
},
{
userDefinedTag: {
id: 1,
tagValue: '用户tag',
updateTime: 1685696500,
createTime: 1685696500,
isValid: 1
}
}
]
},
msg: 'OK'
}
}
}
export default mockData

View File

@@ -0,0 +1,91 @@
const mockData = {
// 空
empty: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: []
}
}
},
bytes: {
// 边界
boundary: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: [
{
eventId: '1308078720390412288',
entityType: 'ip',
serverIp: '116.178.78.180',
domain: null,
appName: null,
eventSeverity: 'critical',
eventType: 'Http error',
startTime: 1686100507,
durationMs: 900,
endTime: 1686104107
},
{
eventId: '1308078720390412289',
entityType: 'ip',
serverIp: '116.178.78.180',
domain: null,
appName: null,
eventSeverity: 'info',
eventType: 'Http error',
startTime: 1686100507,
durationMs: 9000000000000,
endTime: 1686104107
}
]
},
msg: 'OK'
}
}
},
// 正常数据
common: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: [
{
eventId: '1308078720390412288',
entityType: 'ip',
serverIp: '116.178.78.180',
domain: null,
appName: null,
eventSeverity: 'critical',
eventType: 'Http error',
startTime: 1686100507,
durationMs: 900000,
endTime: 1686104107
},
{
eventId: '1308078720390412289',
entityType: 'ip',
serverIp: '116.178.78.180',
domain: null,
appName: null,
eventSeverity: 'info',
eventType: 'Http error',
startTime: 1686100507,
durationMs: 900000,
endTime: 1686104107
}
]
},
msg: 'OK'
}
}
}
export default mockData

View File

@@ -0,0 +1,87 @@
const mockData = {
// 空
empty: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: []
}
}
},
bytes: {
// 边界
boundary: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: []
},
msg: 'OK'
}
}
},
// 正常数据
common: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: [
{
eventId: '1298414830886991872',
securityType: 'command and control',
domain: null,
offenderIp: '213.186.33.5',
victimIp: '116.178.217.92',
offenderDomain: 'baidu.com',
victimDomain: 'mi.com',
eventSeverity: 'critical',
malwareName: 'NetWire RC',
cryptominingPool: null,
startTime: 1683186600,
durationMs: 300000,
endTime: 1683186900
},
{
eventId: '1298414830886991873',
securityType: 'command and control',
domain: null,
offenderIp: '213.186.33.5',
victimIp: '116.178.217.93',
offenderDomain: 'baidu.com',
victimDomain: 'mi.com',
eventSeverity: 'low',
malwareName: 'NetWire RC',
cryptominingPool: null,
startTime: 1683186600,
durationMs: 300000,
endTime: 1683186900
},
{
eventId: '1298414830886991873',
securityType: 'command and control',
domain: null,
offenderIp: '213.186.33.5',
victimIp: '116.178.217.93',
offenderDomain: 'baidu.com',
victimDomain: 'mi.com',
eventSeverity: 'low',
malwareName: 'NetWire RC',
cryptominingPool: null,
startTime: 1683186600,
durationMs: 300000,
endTime: 1683186900
}
]
},
msg: 'OK'
}
}
}
export default mockData