status-go/protocol/identity/social_links_test.go

32 lines
693 B
Go
Raw Normal View History

2022-08-02 12:56:26 +00:00
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)
2023-06-05 11:10:26 +00:00
require.False(t, socialLinks.Equal(transformedLinks))
2022-08-02 12:56:26 +00:00
protobufLinks = append(protobufLinks, &protobuf.SocialLink{Text: "A", Url: "B"})
protobufLinks = append(protobufLinks, &protobuf.SocialLink{Text: "X", Url: "Y"})
transformedLinks = NewSocialLinks(protobufLinks)
2023-06-05 11:10:26 +00:00
require.True(t, socialLinks.Equal(transformedLinks))
2022-08-02 12:56:26 +00:00
}