fix(netflow): сохранять черновики и показывать подтверждённые результаты
This commit is contained in:
1 parent
c9b0f9266e
commit
fcd8de2a96
9 files changed
+222
-156
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import assert from "node:assert/strict"
|
||||
import {test} from "node:test"
|
||||
import {emptyNetflowDraft,netflowDraftPatch} from "./netflow-settings-form"
|
||||
test("NetFlow form sends selected values without defaulting invalid neighbours",()=>{
|
||||
assert.deepEqual(netflowDraftPatch({...emptyNetflowDraft,flowListenPort:"4740"},new Set(["flowListenPort"])),{flowListenPort:4740})
|
||||
assert.deepEqual(netflowDraftPatch({...emptyNetflowDraft,enabled:false,shareOn:false},new Set(["enabled","shareOn"])),{enabled:false,mapServiceMinSharePct:0})
|
||||
assert.deepEqual(netflowDraftPatch({...emptyNetflowDraft,shareOn:true,mapServiceMinSharePct:"0.25"},new Set(["shareOn","mapServiceMinSharePct"])),{mapServiceMinSharePct:0.25})
|
||||
for(const raw of ["0","65536","4739x","4.5",""])assert.throws(()=>netflowDraftPatch({...emptyNetflowDraft,flowListenPort:raw},new Set(["flowListenPort"])))
|
||||
for(const raw of ["0","100.01","NaN",""])assert.throws(()=>netflowDraftPatch({...emptyNetflowDraft,shareOn:true,mapServiceMinSharePct:raw},new Set(["mapServiceMinSharePct"])))
|
||||
})
|
||||
Reference in new issue
Block a user