package com.peachpasswords.sync import org.junit.Assert.assertEquals import org.junit.Test class RelaySettingsPropagationTest { @Test fun changing_mesh_relay_updates_every_existing_pair() { val devices = listOf( PairedDevice( deviceId = "browser", relayUrl = "wss://old-relay.example", pairedAt = 1L, ), PairedDevice( deviceId = "phone", relayUrl = null, pairedAt = 2L, ), ) val updated = withRelayUrl(devices, "wss://new-relay.example/base") assertEquals( listOf( "wss://new-relay.example/base", "wss://new-relay.example/base", ), updated.map { it.relayUrl }, ) assertEquals(listOf("browser", "phone"), updated.map { it.deviceId }) } }