You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-07-15 23:54:29 +02:00
Display board statistics (#4025)
* initial commit for displaying board statistics * lint fixes * i18n-extract, remove log entries, cleanup * more lint fixes * add check for standalone mode * update tests due to change to NotImplemented * lint fix * revert removing empty comment lines Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
@ -3773,3 +3773,40 @@ func TestPermissionsChannel(t *testing.T) {
|
||||
runTestCases(t, ttCases, testData, clients)
|
||||
})
|
||||
}
|
||||
|
||||
func TestPermissionsGetStatistics(t *testing.T) {
|
||||
t.Run("plugin", func(t *testing.T) {
|
||||
th := SetupTestHelperPluginMode(t)
|
||||
defer th.TearDown()
|
||||
clients := setupClients(th)
|
||||
testData := setupData(t, th)
|
||||
ttCases := []TestCase{
|
||||
{"/statistics", methodGet, "", userAnon, http.StatusUnauthorized, 0},
|
||||
{"/statistics", methodGet, "", userNoTeamMember, http.StatusForbidden, 0},
|
||||
{"/statistics", methodGet, "", userTeamMember, http.StatusForbidden, 0},
|
||||
{"/statistics", methodGet, "", userViewer, http.StatusForbidden, 0},
|
||||
{"/statistics", methodGet, "", userCommenter, http.StatusForbidden, 0},
|
||||
{"/statistics", methodGet, "", userEditor, http.StatusForbidden, 0},
|
||||
{"/statistics", methodGet, "", userAdmin, http.StatusOK, 1},
|
||||
{"/statistics", methodGet, "", userGuest, http.StatusForbidden, 0},
|
||||
}
|
||||
runTestCases(t, ttCases, testData, clients)
|
||||
})
|
||||
t.Run("local", func(t *testing.T) {
|
||||
th := SetupTestHelperLocalMode(t)
|
||||
defer th.TearDown()
|
||||
clients := setupLocalClients(th)
|
||||
testData := setupData(t, th)
|
||||
ttCases := []TestCase{
|
||||
{"/statistics", methodGet, "", userAnon, http.StatusUnauthorized, 0},
|
||||
{"/statistics", methodGet, "", userNoTeamMember, http.StatusNotImplemented, 0},
|
||||
{"/statistics", methodGet, "", userTeamMember, http.StatusNotImplemented, 0},
|
||||
{"/statistics", methodGet, "", userViewer, http.StatusNotImplemented, 0},
|
||||
{"/statistics", methodGet, "", userCommenter, http.StatusNotImplemented, 0},
|
||||
{"/statistics", methodGet, "", userEditor, http.StatusNotImplemented, 0},
|
||||
{"/statistics", methodGet, "", userAdmin, http.StatusNotImplemented, 1},
|
||||
{"/statistics", methodGet, "", userGuest, http.StatusForbidden, 0},
|
||||
}
|
||||
runTestCases(t, ttCases, testData, clients)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user