2017-04-12 08:27:57 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2015-06-14 23:53:32 -08:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
"testing"
|
2019-10-04 17:07:01 +08:00
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2015-06-14 23:53:32 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestSuggestCommandJson(t *testing.T) {
|
|
|
|
|
command := &SuggestCommand{Suggestion: NewId()}
|
|
|
|
|
json := command.ToJson()
|
|
|
|
|
result := SuggestCommandFromJson(strings.NewReader(json))
|
|
|
|
|
|
2019-10-04 17:07:01 +08:00
|
|
|
assert.Equal(t, command.Suggestion, result.Suggestion, "Ids do not match")
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|