status-go/protocol/identity/social_links_test.go
Patryk Osmaczko 4143de3816 feat: add social links
iterates: #2782
2022-08-16 14:29:00 +02:00

36 lines
793 B
Go

package identity
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/protocol/protobuf"
)
func TestEquals(t *testing.T) {
socialLinks := SocialLinks{
{
Text: "A",
URL: "B",
},
{
Text: "X",
URL: "Y",
},
}
other := []*protobuf.SocialLink{}
require.False(t, socialLinks.EqualsProtobuf(other))
other = append(other, &protobuf.SocialLink{Text: "A", Url: "B"})
other = append(other, &protobuf.SocialLink{Text: "X", Url: "Y"})
require.True(t, socialLinks.EqualsProtobuf(other))
// order does not matter
other = []*protobuf.SocialLink{}
other = append(other, &protobuf.SocialLink{Text: "X", Url: "Y"})
other = append(other, &protobuf.SocialLink{Text: "A", Url: "B"})
require.True(t, socialLinks.EqualsProtobuf(other))
}