diff options
author | Panagiotis "Ivory" Vasilopoulos <git@n0toose.net> | 2023-07-31 08:44:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-31 08:44:45 +0000 |
commit | d58c5425799335ea57f27461f99ddd1078e9b2de (patch) | |
tree | 917fac7672c6204e9b928385f856a5156e9dbec2 /tests/integration/user_test.go | |
parent | 72363be7caa3c253e08daf058e5aebd6e795f0ef (diff) | |
download | gitea-d58c5425799335ea57f27461f99ddd1078e9b2de.tar.gz gitea-d58c5425799335ea57f27461f99ddd1078e9b2de.zip |
Add 'Show on a map' button to Location in profile, fix layout (#26214)
Not too important, but I think that it'd be a pretty neat touch.
Also fixes some layout bugs introduced by a previous PR.
---------
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'tests/integration/user_test.go')
-rw-r--r-- | tests/integration/user_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/integration/user_test.go b/tests/integration/user_test.go index 3e4d967686..ddde415960 100644 --- a/tests/integration/user_test.go +++ b/tests/integration/user_test.go @@ -12,6 +12,7 @@ import ( repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" + "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/test" "code.gitea.io/gitea/modules/translation" @@ -276,3 +277,23 @@ func TestListStopWatches(t *testing.T) { assert.Greater(t, apiWatches[0].Seconds, int64(0)) } } + +func TestUserLocationMapLink(t *testing.T) { + setting.Service.UserLocationMapURL = "https://example/foo/" + defer tests.PrepareTestEnv(t)() + + session := loginUser(t, "user2") + req := NewRequestWithValues(t, "POST", "/user/settings", map[string]string{ + "_csrf": GetCSRF(t, session, "/user/settings"), + "name": "user2", + "email": "user@example.com", + "language": "en-US", + "location": "A/b", + }) + session.MakeRequest(t, req, http.StatusSeeOther) + + req = NewRequest(t, "GET", "/user2/") + resp := session.MakeRequest(t, req, http.StatusOK) + htmlDoc := NewHTMLParser(t, resp.Body) + htmlDoc.AssertElement(t, `a[href="https://example/foo/A%2Fb"]`, true) +} |