mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-11 16:24:11 +01:00
22 lines
447 B
Go
22 lines
447 B
Go
package api
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAppendWebsocketTopics(t *testing.T) {
|
|
original := append([]string(nil), WebsocketTopics...)
|
|
|
|
t.Cleanup(func() {
|
|
WebsocketTopics = original
|
|
})
|
|
|
|
AppendWebsocketTopics("audit.log.*", "custom.topic")
|
|
|
|
require.Len(t, WebsocketTopics, len(original)+2)
|
|
require.Contains(t, WebsocketTopics, "audit.log.*")
|
|
require.Contains(t, WebsocketTopics, "custom.topic")
|
|
}
|