status-go/protocol/identity/social_links_test.go

32 lines
693 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",
},
}
protobufLinks := []*protobuf.SocialLink{}
transformedLinks := NewSocialLinks(protobufLinks)
require.False(t, socialLinks.Equal(transformedLinks))
protobufLinks = append(protobufLinks, &protobuf.SocialLink{Text: "A", Url: "B"})
protobufLinks = append(protobufLinks, &protobuf.SocialLink{Text: "X", Url: "Y"})
transformedLinks = NewSocialLinks(protobufLinks)
require.True(t, socialLinks.Equal(transformedLinks))
}