go-ssb-room/web/handlers/admin/handler_test.go

28 lines
637 B
Go
Raw Normal View History

2021-02-11 15:43:19 +00:00
package admin
import (
"net/http"
"testing"
"github.com/ssb-ngi-pointer/go-ssb-room/web/router"
"github.com/ssb-ngi-pointer/go-ssb-room/web/webassert"
2021-02-11 15:43:19 +00:00
"github.com/stretchr/testify/assert"
)
func TestDashoard(t *testing.T) {
ts := newSession(t)
a := assert.New(t)
url, err := ts.Router.Get(router.AdminDashboard).URL()
a.Nil(err)
html, resp := ts.Client.GetHTML(url.String())
2021-02-11 15:43:19 +00:00
a.Equal(http.StatusOK, resp.Code, "wrong HTTP status code")
2021-02-15 13:56:17 +00:00
webassert.Localized(t, html, []webassert.LocalizedElement{
2021-02-11 15:43:19 +00:00
{"#welcome", "AdminDashboardWelcome"},
{"title", "AdminDashboardTitle"},
{"#roomCount", "AdminRoomCountPlural"},
})
}