update tests for new dashboard template
This commit is contained in:
parent
313405d469
commit
a9027250d3
|
@ -19,9 +19,12 @@ func TestDashoard(t *testing.T) {
|
|||
html, resp := ts.Client.GetHTML(url.String())
|
||||
a.Equal(http.StatusOK, resp.Code, "wrong HTTP status code")
|
||||
|
||||
a.Equal(1, html.Find("#online").Size())
|
||||
a.Equal(1, html.Find("#members").Size())
|
||||
a.Equal(1, html.Find("#invites").Size())
|
||||
a.Equal(1, html.Find("#banned").Size())
|
||||
|
||||
webassert.Localized(t, html, []webassert.LocalizedElement{
|
||||
{"#welcome", "AdminDashboardWelcome"},
|
||||
{"title", "AdminDashboardTitle"},
|
||||
{"#roomCount", "AdminRoomCountPlural"},
|
||||
})
|
||||
}
|
||||
|
|
|
@ -154,7 +154,6 @@ func TestFallbackAuth(t *testing.T) {
|
|||
}
|
||||
|
||||
webassert.Localized(t, html, []webassert.LocalizedElement{
|
||||
{"#welcome", "AdminDashboardWelcome"},
|
||||
{"title", "AdminDashboardTitle"},
|
||||
})
|
||||
|
||||
|
@ -166,9 +165,7 @@ func TestFallbackAuth(t *testing.T) {
|
|||
t.Log(html.Find("body").Text())
|
||||
}
|
||||
webassert.Localized(t, html, []webassert.LocalizedElement{
|
||||
{"#welcome", "AdminDashboardWelcome"},
|
||||
{"title", "AdminDashboardTitle"},
|
||||
{"#roomCount", "AdminRoomCountSingular"},
|
||||
})
|
||||
|
||||
testRef2 := refs.FeedRef{Algo: "test", ID: bytes.Repeat([]byte{1}, 16)}
|
||||
|
@ -178,9 +175,7 @@ func TestFallbackAuth(t *testing.T) {
|
|||
a.Equal(http.StatusOK, resp.Code, "wrong HTTP status code")
|
||||
|
||||
webassert.Localized(t, html, []webassert.LocalizedElement{
|
||||
{"#welcome", "AdminDashboardWelcome"},
|
||||
{"title", "AdminDashboardTitle"},
|
||||
{"#roomCount", "AdminRoomCountPlural"},
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -374,8 +369,12 @@ func TestAuthWithSSBClientInitHasClient(t *testing.T) {
|
|||
t.Log(html.Find("body").Text())
|
||||
}
|
||||
|
||||
a.Equal(1, html.Find("#online").Size())
|
||||
a.Equal(1, html.Find("#members").Size())
|
||||
a.Equal(1, html.Find("#invites").Size())
|
||||
a.Equal(1, html.Find("#banned").Size())
|
||||
|
||||
webassert.Localized(t, html, []webassert.LocalizedElement{
|
||||
{"#welcome", "AdminDashboardWelcome"},
|
||||
{"title", "AdminDashboardTitle"},
|
||||
})
|
||||
}
|
||||
|
@ -502,7 +501,6 @@ func TestAuthWithSSBServerInitHappyPath(t *testing.T) {
|
|||
}
|
||||
|
||||
webassert.Localized(t, html, []webassert.LocalizedElement{
|
||||
{"#welcome", "AdminDashboardWelcome"},
|
||||
{"title", "AdminDashboardTitle"},
|
||||
})
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ type testSession struct {
|
|||
AliasesDB *mockdb.FakeAliasesService
|
||||
MembersDB *mockdb.FakeMembersService
|
||||
InvitesDB *mockdb.FakeInvitesService
|
||||
DeniedKeysDB *mockdb.FakeDeniedKeysService
|
||||
PinnedDB *mockdb.FakePinnedNoticesService
|
||||
NoticeDB *mockdb.FakeNoticesService
|
||||
|
||||
|
@ -76,6 +77,7 @@ func setup(t *testing.T) *testSession {
|
|||
ts.AliasesDB = new(mockdb.FakeAliasesService)
|
||||
ts.MembersDB = new(mockdb.FakeMembersService)
|
||||
ts.InvitesDB = new(mockdb.FakeInvitesService)
|
||||
ts.DeniedKeysDB = new(mockdb.FakeDeniedKeysService)
|
||||
ts.PinnedDB = new(mockdb.FakePinnedNoticesService)
|
||||
defaultNotice := &roomdb.Notice{
|
||||
Title: "Default Notice Title",
|
||||
|
@ -118,6 +120,7 @@ func setup(t *testing.T) *testSession {
|
|||
AuthWithSSB: ts.AuthWithSSB,
|
||||
Members: ts.MembersDB,
|
||||
Invites: ts.InvitesDB,
|
||||
DeniedKeys: ts.DeniedKeysDB,
|
||||
Notices: ts.NoticeDB,
|
||||
PinnedNotices: ts.PinnedDB,
|
||||
},
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
<div class="flex flex-col-reverse sm:flex-row justify-start items-stretch ">
|
||||
<div
|
||||
id="online"
|
||||
class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start"
|
||||
>
|
||||
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
|
||||
|
@ -26,6 +27,7 @@
|
|||
</div>
|
||||
|
||||
<div
|
||||
id="members"
|
||||
class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start"
|
||||
>
|
||||
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
|
||||
|
@ -40,6 +42,7 @@
|
|||
</div>
|
||||
|
||||
<div
|
||||
id="invites"
|
||||
class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start"
|
||||
>
|
||||
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
|
||||
|
@ -54,6 +57,7 @@
|
|||
</div>
|
||||
|
||||
<div
|
||||
id="banned"
|
||||
class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start"
|
||||
>
|
||||
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
|
||||
|
|
Loading…
Reference in New Issue