summaryrefslogtreecommitdiffstats
path: root/api4/webrtc_test.go
blob: 806118f76d36437de43088306665b1f49efdaf80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

package api4

import (
	"testing"

	"github.com/mattermost/platform/utils"
)

func TestGetWebrtcToken(t *testing.T) {
	th := Setup().InitBasic().InitSystemAdmin()
	defer TearDown()
	Client := th.Client

	enableWebrtc := *utils.Cfg.WebrtcSettings.Enable
	defer func() {
		*utils.Cfg.WebrtcSettings.Enable = enableWebrtc
	}()
	*utils.Cfg.WebrtcSettings.Enable = false

	_, resp := Client.GetWebrtcToken()
	CheckNotImplementedStatus(t, resp)

	Client.Logout()
	_, resp = Client.GetWebrtcToken()
	CheckUnauthorizedStatus(t, resp)
}