mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-21 13:38:56 +02:00
22aae37dd1
* retrieve additional user fields * implement config setting * cleanup * fix tests * remove unused constant * fix more tests * add tests, cleanup * lint fixes * revert bad lint fixes * more merge fixes * update to use personal setting * add user settings * update package-lock.json * lint fixes * npm audit fix * update tests * Revert "lint fixes" This reverts commit6a50d335ca
. * Revert "update package-lock.json" This reverts commit1117e557e4
. * Revert "npm audit fix" This reverts commit77ea931c77
. * Revert "Revert "lint fixes"" This reverts commit3ebd81b9fa
. * restore to original * fix for empty prefs * fix bad merge Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
33 lines
1.0 KiB
Go
33 lines
1.0 KiB
Go
package app
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mattermost/focalboard/server/services/config"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGetClientConfig(t *testing.T) {
|
|
th, tearDown := SetupTestHelper(t)
|
|
defer tearDown()
|
|
|
|
t.Run("Test Get Client Config", func(t *testing.T) {
|
|
newConfiguration := config.Configuration{}
|
|
newConfiguration.Telemetry = true
|
|
newConfiguration.TelemetryID = "abcde"
|
|
newConfiguration.EnablePublicSharedBoards = true
|
|
newConfiguration.FeatureFlags = make(map[string]string)
|
|
newConfiguration.FeatureFlags["BoardsFeature1"] = "true"
|
|
newConfiguration.FeatureFlags["BoardsFeature2"] = "true"
|
|
newConfiguration.TeammateNameDisplay = "username"
|
|
th.App.SetConfig(&newConfiguration)
|
|
|
|
clientConfig := th.App.GetClientConfig()
|
|
require.True(t, clientConfig.EnablePublicSharedBoards)
|
|
require.True(t, clientConfig.Telemetry)
|
|
require.Equal(t, "abcde", clientConfig.TelemetryID)
|
|
require.Equal(t, 2, len(clientConfig.FeatureFlags))
|
|
require.Equal(t, "username", clientConfig.TeammateNameDisplay)
|
|
})
|
|
}
|