From beb6bf4261ace56f9c97c03f709b4fe29746b3d7 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 28 Oct 2020 22:33:14 +0000 Subject: Remove obsolete change of email on profile page (#13341) * Remove obsolete change of email on profile page The change email on the account profile page is out-of-date and unnecessary. Changing email should be done using the account page. Fix #13336 Signed-off-by: Andrew Thornton --- integrations/auth_ldap_test.go | 2 +- integrations/html_helper.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'integrations') diff --git a/integrations/auth_ldap_test.go b/integrations/auth_ldap_test.go index 520a611eab..1569458418 100644 --- a/integrations/auth_ldap_test.go +++ b/integrations/auth_ldap_test.go @@ -141,7 +141,7 @@ func TestLDAPUserSignin(t *testing.T) { assert.Equal(t, u.UserName, htmlDoc.GetInputValueByName("name")) assert.Equal(t, u.FullName, htmlDoc.GetInputValueByName("full_name")) - assert.Equal(t, u.Email, htmlDoc.GetInputValueByName("email")) + assert.Equal(t, u.Email, htmlDoc.Find(`label[for="email"]`).Siblings().First().Text()) } func TestLDAPUserSync(t *testing.T) { diff --git a/integrations/html_helper.go b/integrations/html_helper.go index 823ed44851..6dc806a76e 100644 --- a/integrations/html_helper.go +++ b/integrations/html_helper.go @@ -37,6 +37,13 @@ func (doc *HTMLDoc) GetInputValueByName(name string) string { return text } +// Find gets the descendants of each element in the current set of +// matched elements, filtered by a selector. It returns a new Selection +// object containing these matched elements. +func (doc *HTMLDoc) Find(selector string) *goquery.Selection { + return doc.doc.Find(selector) +} + // GetCSRF for get CSRC token value from input func (doc *HTMLDoc) GetCSRF() string { return doc.GetInputValueByName("_csrf") -- cgit v1.2.3