fix(ui): проверять источник IPv4 для диагностики

This commit is contained in:
Denozordec committed 2026-10-01 08:36:31 +07:00
1 parent d0c715e93c
commit b60b7ac8e8
8 files changed
+81 -26

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
import {test} from "node:test"
import assert from "node:assert/strict"
import {readProbeSource} from "./probe-source"
test("Preview принимает только IPv4 текущего host, null остаётся неизвестностью",()=>{assert.equal(readProbeSource({host:"router.test",ipv4:"192.0.2.1"},"router.test"),"192.0.2.1");assert.equal(readProbeSource({host:"router.test",ipv4:null},"router.test"),null);for(const raw of [{ipv4:"192.0.2.1"},{host:"other.test",ipv4:"192.0.2.1"},{host:"router.test",ipv4:"999.0.0.1"},{host:"router.test",ipv4:"192.000.2.1"},{host:"router.test",ipv4:"::1"},{}])assert.throws(()=>readProbeSource(raw,"router.test"))})