Skip to content

Commit

Permalink
update wailing & ailing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cblgh committed Apr 16, 2021
1 parent 19a4224 commit 151408d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions web/handlers/admin/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func newSession(t *testing.T) *testSession {
r,
ts.RoomState,
flashHelper,
locHelper,
Databases{
Aliases: ts.AliasesDB,
Config: ts.ConfigDB,
Expand Down
4 changes: 2 additions & 2 deletions web/handlers/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ func New(

session, err := cookieStore.Get(req, i18n.LanguageCookieName)
if err != nil {
fmt.Printf("cookie error? %w\n", err)
fmt.Errorf("cookie error? %w\n", err)
return
}

session.Values["lang"] = lang
err = session.Save(req, w)
if err != nil {
fmt.Printf("we failed to save the language session cookie %w\n", err)
fmt.Errorf("we failed to save the language session cookie %w\n", err)
}

http.Redirect(w, req, previousRoute, http.StatusSeeOther)
Expand Down
2 changes: 1 addition & 1 deletion web/handlers/invites_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestInviteConsumeInviteHTTP(t *testing.T) {

// get the corresponding token from the page
csrfTokenElem := doc.Find("input[name='gorilla.csrf.Token']")
a.Equal(1, csrfTokenElem.Length())
a.Equal(3, csrfTokenElem.Length())
csrfName, has := csrfTokenElem.Attr("name")
a.True(has, "should have a name attribute")
csrfValue, has := csrfTokenElem.Attr("value")
Expand Down
2 changes: 1 addition & 1 deletion web/handlers/notices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestNoticesEditButtonVisible(t *testing.T) {
a.True(len(csrfCookie) > 0, "should have one cookie for CSRF protection validation")

csrfTokenElem := doc.Find("input[type=hidden]")
a.Equal(1, csrfTokenElem.Length())
a.Equal(7, csrfTokenElem.Length())

csrfName, has := csrfTokenElem.Attr("name")
a.True(has, "should have a name attribute")
Expand Down

0 comments on commit 151408d

Please sign in to comment.