Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Mar 19, 2024
1 parent 07c23c9 commit d1e777d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/integration/explore_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ func TestExploreUser(t *testing.T) {
defer tests.PrepareTestEnv(t)()

cases := []struct{ sortOrder, expected string }{
{"", "/explore/users?sort=newest&q="},
{"newest", "/explore/users?sort=newest&q="},
{"oldest", "/explore/users?sort=oldest&q="},
{"alphabetically", "/explore/users?sort=alphabetically&q="},
{"reversealphabetically", "/explore/users?sort=reversealphabetically&q="},
{"", "?sort=newest&q="},
{"newest", "?sort=newest&q="},
{"oldest", "?sort=oldest&q="},
{"alphabetically", "?sort=alphabetically&q="},
{"reversealphabetically", "?sort=reversealphabetically&q="},
}
for _, c := range cases {
req := NewRequest(t, "GET", "/explore/users?sort="+c.sortOrder)
resp := MakeRequest(t, req, http.StatusOK)
h := NewHTMLParser(t, resp.Body)
href, _ := h.Find(`.ui.dropdown .menu a.active.item[href^="/explore/users"]`).Attr("href")
href, _ := h.Find(`.ui.dropdown .menu a.active.item[href^="?sort="]`).Attr("href")
assert.Equal(t, c.expected, href)
}

Expand Down

0 comments on commit d1e777d

Please sign in to comment.