From eb163e98ebcf68dd6d8e4476f404836771f9bfcb Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Thu, 25 Jul 2024 11:17:25 +0200 Subject: [PATCH] add save peer status test for connected peers --- management/server/sql_store_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/management/server/sql_store_test.go b/management/server/sql_store_test.go index f46ca7e5db1..7f48810d7eb 100644 --- a/management/server/sql_store_test.go +++ b/management/server/sql_store_test.go @@ -402,6 +402,17 @@ func TestSqlite_SavePeerStatus(t *testing.T) { actual := account.Peers["testpeer"].Status assert.Equal(t, newStatus, *actual) + + newStatus.Connected = true + + err = store.SavePeerStatus(account.Id, "testpeer", newStatus) + require.NoError(t, err) + + account, err = store.GetAccount(context.Background(), account.Id) + require.NoError(t, err) + + actual = account.Peers["testpeer"].Status + assert.Equal(t, newStatus, *actual) } func TestSqlite_SavePeerLocation(t *testing.T) { if runtime.GOOS == "windows" {