Plugin API hook for Shared Channel file attachment sync (#25874)
* option for auto inviting plugin to all shared channels. * auto-invite remotes to shared channels when flag set * fix unit test * immediately ping new remotes; fix unique siteurl bug * make i18n-extract * fix translations * plugin hooks for file attachments * hook for profile image sync * fix profile image sync * fix unit test --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -21,6 +21,7 @@ func TestRemoteClusterStore(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("RemoteClusterSave", func(t *testing.T) { testRemoteClusterSave(t, rctx, ss) })
|
||||
t.Run("RemoteClusterDelete", func(t *testing.T) { testRemoteClusterDelete(t, rctx, ss) })
|
||||
t.Run("RemoteClusterGet", func(t *testing.T) { testRemoteClusterGet(t, rctx, ss) })
|
||||
t.Run("RemoteClusterGetByPluginID", func(t *testing.T) { testRemoteClusterGetByPluginID(t, rctx, ss) })
|
||||
t.Run("RemoteClusterGetAll", func(t *testing.T) { testRemoteClusterGetAll(t, rctx, ss) })
|
||||
t.Run("RemoteClusterGetByTopic", func(t *testing.T) { testRemoteClusterGetByTopic(t, rctx, ss) })
|
||||
t.Run("RemoteClusterUpdateTopics", func(t *testing.T) { testRemoteClusterUpdateTopics(t, rctx, ss) })
|
||||
@@ -191,6 +192,31 @@ func testRemoteClusterGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
})
|
||||
}
|
||||
|
||||
func testRemoteClusterGetByPluginID(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
const pluginID = "com.acme.bogus.plugin"
|
||||
|
||||
t.Run("GetByPluginID", func(t *testing.T) {
|
||||
rc := &model.RemoteCluster{
|
||||
Name: "shortlived_remote_3",
|
||||
SiteURL: makeSiteURL(),
|
||||
CreatorId: model.NewId(),
|
||||
PluginID: pluginID,
|
||||
}
|
||||
rcSaved, err := ss.RemoteCluster().Save(rc)
|
||||
require.NoError(t, err)
|
||||
|
||||
rcGet, err := ss.RemoteCluster().GetByPluginID(pluginID)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, rcSaved.RemoteId, rcGet.RemoteId)
|
||||
require.Equal(t, pluginID, rcGet.PluginID)
|
||||
})
|
||||
|
||||
t.Run("GetByPluginID not found", func(t *testing.T) {
|
||||
_, err := ss.RemoteCluster().GetByPluginID(model.NewId())
|
||||
require.Error(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
func testRemoteClusterGetAll(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, clearRemoteClusters(ss))
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user