github.com/nhannv/mattermost-server@v5.11.1+incompatible/model/emoji_search_test.go (about)

     1  // Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved.
     2  // See License.txt for license information.
     3  
     4  package model
     5  
     6  import (
     7  	"strings"
     8  	"testing"
     9  )
    10  
    11  func TestEmojiSearchJson(t *testing.T) {
    12  	emojiSearch := EmojiSearch{Term: NewId()}
    13  	json := emojiSearch.ToJson()
    14  	remojiSearch := EmojiSearchFromJson(strings.NewReader(json))
    15  
    16  	if emojiSearch.Term != remojiSearch.Term {
    17  		t.Fatal("Terms do not match")
    18  	}
    19  }