Files
Paulus Schoutsen b0f498b5d3 Add LoRaWAN connectivity panel (#54998)
* Add LoRaWAN device overview and connection details

* Add LoRaWAN overview, connections, and topology views

* Match Bluetooth connection list navigation

* Simplify LoRaWAN add-device dialog navigation

* Group LoRaWAN devices by connection and simplify mobile rows

* Fix LoRa icon wave paths

* Use floating Add device action on LoRaWAN overview

* Widen LoRaWAN connection picker and simplify demo connections

* Use public console destinations in LoRaWAN demo

* Show two TTN gateways and one ChirpStack gateway in demo

* Simplify LoRaWAN connection picker heading

* Keep LoRaWAN Add device dialog compact on mobile

* Simplify LoRaWAN device details and widen unsupported-device alert

* Use the brand server for LoRaWAN demo icons

* Revert demo loading screen layout change

* Move LoRaWAN topology helper into the panel

* Select LoRaWAN device in subscription callback

* Only show LoRaWAN info for matching device integrations

* Name LoRaWAN pages by their purpose

* Identify LoRaWAN integrations by their dependency

* Fix LoRaWAN table sorting and column updates

* Refresh LoRaWAN details when navigating between devices

* Fix LoRaWAN device search, grouping, and demo entity IDs

* Treat listed LoRaWAN connections as active

* Use sensecap_lorawan domain in LoRaWAN demo
2026-10-17 14:46:23 -04:00

28 lines
953 B
TypeScript

import { describe, expect, it } from "vitest";
import { strongestLoRaWANReception } from "../../src/data/lorawan";
describe("strongestLoRaWANReception", () => {
it("keeps RSSI and SNR from the same gateway", () => {
const weak = { gateway_id: "garden", rssi: -98, snr: 12 };
const strong = { gateway_id: "home", rssi: -61, snr: 4 };
expect(strongestLoRaWANReception([weak, strong])).toBe(strong);
});
it("ignores missing RSSI without treating zero as missing", () => {
const zero = { gateway_id: "home", rssi: 0, snr: null };
expect(
strongestLoRaWANReception([
{ gateway_id: "unknown", rssi: null, snr: 4 },
zero,
])
).toBe(zero);
});
it("has no strongest reception when no RSSI was received", () => {
expect(strongestLoRaWANReception([])).toBeUndefined();
expect(
strongestLoRaWANReception([{ gateway_id: "unknown", rssi: null, snr: 4 }])
).toBeUndefined();
});
});