2021-02-11 15:43:19 +00:00
|
|
|
package admin
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/ssb-ngi-pointer/go-ssb-room/web/router"
|
2021-03-11 08:55:38 +00:00
|
|
|
"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)
|
|
|
|
|
2021-02-16 12:10:32 +00:00
|
|
|
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
|
|
|
|
2021-03-11 08:55:38 +00:00
|
|
|
webassert.Localized(t, html, []webassert.LocalizedElement{
|
2021-02-11 15:43:19 +00:00
|
|
|
{"#welcome", "AdminDashboardWelcome"},
|
|
|
|
{"title", "AdminDashboardTitle"},
|
|
|
|
{"#roomCount", "AdminRoomCountPlural"},
|
|
|
|
})
|
|
|
|
}
|