fix(web): reveal NFC peripherals after detection

This commit is contained in:
Miayui
2026-09-21 11:04:18 +08:00
parent 448c8b31a0
commit b3bd90f748
9 changed files with 75 additions and 14 deletions
@@ -102,3 +102,17 @@ def test_device_card_surfaces_extension_toy_mqtt_delivery() -> None:
assert "extensionToySnapshot.last_error" in apply_toy
assert "applyExtensionToySnapshot(value.extension_toy" in apply_nfc
assert "正在准备 extension/toy 消息" in apply_nfc
def test_homepage_only_reveals_nfc_devices_detected_in_this_run() -> None:
source = SOURCE_PATH.read_text(encoding="utf-8")
unified = _function_source(
source,
" function buildUnifiedExtensionSync() {",
"\n function init()",
)
assert "detected_nfc_ids" in source
assert "const detectedNfcIds = new Set(" in unified
assert "detectedNfcIds.has(normalizeCardUid(device.cardUid))" in unified
assert "检测到已绑定的 NFC 后,外设将在本次运行期间持续显示" in unified