Skip to content

Commit

Permalink
fix tests due yo navabr icon
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesago committed Feb 15, 2022
1 parent 861363d commit 6c633fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion handlers/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ func TestLogin(t *testing.T) {
fmt.Println("= Login")
resp, _ := testLogin(t, router, "serviceapp", "dogood", nil) // user without otp
assert.Equal(t, 200, resp.Code, "http GET success first user profile")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "class=\"navbar-brand\">serviceapp</span>"), "http GET success first user profile")
fmt.Printf("%+v\n",resp)
assert.Equal(t, true, strings.Contains(resp.Body.String(), "> serviceapp</span>"), "http GET success first user profile")

Data.Users[2].Disabled = true // serviceapp user disabled
resp, _ = testLogin(t, router, "serviceapp", "dogood", nil) // user without otp
Expand Down
6 changes: 3 additions & 3 deletions routes/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestSession(t *testing.T) {
usercookie := cookie
assert.Equal(t, 200, resp.Code, "http GET success user login")
//assert.Equal(t, true, strings.Contains(resp.Body.String(), "Welcome user"), "http GET success first access user")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "class=\"navbar-brand\">user</span>"), "http GET success first access user")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "> user</span>"), "http GET success first access user")
// test badlogin
resp, cookie, location = testLogin(t, router, "baduser", "dogood")
assert.Equal(t, 200, resp.Code, "http GET success first user profile")
Expand All @@ -101,7 +101,7 @@ func TestSession(t *testing.T) {
admincookie := cookie
assert.Equal(t, 200, resp.Code, "http GET success admin login")
//assert.Equal(t, true, strings.Contains(resp.Body.String(), "Welcome admin"), "http GET success first access admin")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "class=\"navbar-brand\">admin</span>"), "http GET success first access user")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "> admin</span>"), "http GET success first access user")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "id=\"nav-otp\""), "show otp nav")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "id=\"nav-chgpwd\""), "show change password nav")
//fmt.Printf("=====\n%+v\n",resp)
Expand All @@ -111,7 +111,7 @@ func TestSession(t *testing.T) {
serviceappcookie := cookie
assert.Equal(t, 200, resp.Code, "http GET success serviceapp login")
//assert.Equal(t, true, strings.Contains(resp.Body.String(), "Welcome serviceapp"), "http GET success first access serviceapp")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "class=\"navbar-brand\">serviceapp</span>"), "http GET success first access user")
assert.Equal(t, true, strings.Contains(resp.Body.String(), "> serviceapp</span>"), "http GET success first access user")
//assert.Equal(t, true, strings.Contains(resp.Body.String(), "id=\"nav-otp\""), "show otp nav")
//assert.Equal(t, true, strings.Contains(resp.Body.String(), "id=\"nav-chgpwd\""), "show change password nav")

Expand Down

0 comments on commit 6c633fc

Please sign in to comment.