mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* Support `server`, deprecate `backend` in plugin manifest This lets us converge on the use of the term `server` everywhere instead of sometimes `backend` and sometimes `server`. We're still using `webapp` and will eventually support `mobile` as well. The plan is actually to rip out these deprecations as part of releasing 5.2, but I want to coordinate the extra additional breakage at the same time, so for now this is a backwards compatible change. * fix failing tests
32 lines
691 B
Go
32 lines
691 B
Go
package model
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPluginsResponseJson(t *testing.T) {
|
|
manifest := &Manifest{
|
|
Id: "theid",
|
|
Server: &ManifestServer{
|
|
Executable: "theexecutable",
|
|
},
|
|
Webapp: &ManifestWebapp{
|
|
BundlePath: "thebundlepath",
|
|
},
|
|
}
|
|
|
|
response := &PluginsResponse{
|
|
Active: []*PluginInfo{{Manifest: *manifest}},
|
|
Inactive: []*PluginInfo{},
|
|
}
|
|
|
|
json := response.ToJson()
|
|
newResponse := PluginsResponseFromJson(strings.NewReader(json))
|
|
assert.Equal(t, newResponse, response)
|
|
assert.Equal(t, newResponse.ToJson(), json)
|
|
assert.Equal(t, PluginsResponseFromJson(strings.NewReader("junk")), (*PluginsResponse)(nil))
|
|
}
|