1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-03-11 00:58:23 +03:00

clarify HasOrgProfileReadme vs HasUserProfileReadme, fix tests

This commit is contained in:
wxiaoguang 2024-12-30 21:56:43 +08:00
parent 93e7a010c3
commit ae3627fd2a
9 changed files with 83 additions and 85 deletions

View File

@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/models/organization" "code.gitea.io/gitea/models/organization"
"code.gitea.io/gitea/models/renderhelper" "code.gitea.io/gitea/models/renderhelper"
repo_model "code.gitea.io/gitea/models/repo" repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/markup/markdown" "code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"
@ -21,9 +22,7 @@ import (
"code.gitea.io/gitea/services/context" "code.gitea.io/gitea/services/context"
) )
const ( const tplOrgHome templates.TplName = "org/home"
tplOrgHome templates.TplName = "org/home"
)
// Home show organization home page // Home show organization home page
func Home(ctx *context.Context) { func Home(ctx *context.Context) {
@ -110,29 +109,13 @@ func home(ctx *context.Context, viewRepositories bool) {
ctx.Data["DisableNewPullMirrors"] = setting.Mirror.DisableNewPull ctx.Data["DisableNewPullMirrors"] = setting.Mirror.DisableNewPull
ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0 ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0
err = shared_user.RenderOrgHeader(ctx) prepareResult, err := shared_user.PrepareOrgHeader(ctx)
if err != nil { if err != nil {
ctx.ServerError("RenderOrgHeader", err) ctx.ServerError("PrepareOrgHeader", err)
return return
} }
isBothProfilesExist := ctx.Data["HasPublicProfileReadme"] == true && ctx.Data["HasPrivateProfileReadme"] == true
isViewerMember := ctx.FormString("view_as") ctx.Data["HasPrivateProfileReadme"] = viewRepositories || !prepareOrgProfileReadme(ctx, prepareResult)
ctx.Data["IsViewerMember"] = isViewerMember == "member"
viewAsPrivate := isViewerMember == "member"
if !isBothProfilesExist {
if !prepareOrgProfileReadme(ctx, prepareOrgProfileReadmeOptions{viewRepositories: viewRepositories}) {
if !prepareOrgProfileReadme(ctx, prepareOrgProfileReadmeOptions{viewRepositories: viewRepositories, viewAsPrivate: true}) {
ctx.Data["PageIsViewRepositories"] = true
}
}
} else {
if !prepareOrgProfileReadme(ctx, prepareOrgProfileReadmeOptions{viewRepositories: viewRepositories, viewAsPrivate: viewAsPrivate}) {
ctx.Data["PageIsViewRepositories"] = true
}
}
var ( var (
repos []*repo_model.Repository repos []*repo_model.Repository
@ -171,36 +154,45 @@ func home(ctx *context.Context, viewRepositories bool) {
ctx.HTML(http.StatusOK, tplOrgHome) ctx.HTML(http.StatusOK, tplOrgHome)
} }
type prepareOrgProfileReadmeOptions struct { func prepareOrgProfileReadme(ctx *context.Context, prepareResult *shared_user.PrepareOrgHeaderResult) bool {
viewRepositories bool viewAs := ctx.FormString("view_as")
viewAsPrivate bool viewAsMember := viewAs == "member"
}
func prepareOrgProfileReadme(ctx *context.Context, opts prepareOrgProfileReadmeOptions) bool { var profileRepo *repo_model.Repository
profileRepoName := util.Iif(opts.viewAsPrivate, shared_user.RepoNameProfilePrivate, shared_user.RepoNameProfile) var readmeBlob *git.Blob
profileDbRepo, profileReadme := shared_user.FindOwnerProfileReadme(ctx, ctx.Doer, profileRepoName) if viewAsMember {
if prepareResult.ProfilePrivateReadmeBlob != nil {
if opts.viewAsPrivate { profileRepo, readmeBlob = prepareResult.ProfilePrivateRepo, prepareResult.ProfilePrivateReadmeBlob
ctx.Data["HasPrivateProfileReadme"] = profileReadme != nil
} else { } else {
ctx.Data["HasPublicProfileReadme"] = profileReadme != nil profileRepo, readmeBlob = prepareResult.ProfilePublicRepo, prepareResult.ProfilePublicReadmeBlob
viewAsMember = false
} }
} else {
if profileReadme == nil || opts.viewRepositories { if prepareResult.ProfilePublicReadmeBlob != nil {
profileRepo, readmeBlob = prepareResult.ProfilePublicRepo, prepareResult.ProfilePublicReadmeBlob
} else {
profileRepo, readmeBlob = prepareResult.ProfilePrivateRepo, prepareResult.ProfilePrivateReadmeBlob
viewAsMember = true
}
}
if readmeBlob == nil {
return false return false
} }
if bytes, err := profileReadme.GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil { readmeBytes, err := readmeBlob.GetBlobContent(setting.UI.MaxDisplayFileSize)
log.Error("failed to GetBlobContent for %s profile readme: %v", profileRepoName, err) if err != nil {
} else { log.Error("failed to GetBlobContent for %q profile (view as %q) readme: %v", ctx.ContextUser.Name, viewAs, err)
rctx := renderhelper.NewRenderContextRepoFile(ctx, profileDbRepo, renderhelper.RepoFileOptions{ return false
CurrentRefPath: path.Join("branch", util.PathEscapeSegments(profileDbRepo.DefaultBranch)), }
rctx := renderhelper.NewRenderContextRepoFile(ctx, profileRepo, renderhelper.RepoFileOptions{
CurrentRefPath: path.Join("branch", util.PathEscapeSegments(profileRepo.DefaultBranch)),
}) })
if profileContent, err := markdown.RenderString(rctx, bytes); err != nil { ctx.Data["ProfileReadmeContent"], err = markdown.RenderString(rctx, readmeBytes)
log.Error("failed to RenderString for %s profile readme: %v", profileRepoName, err) if err != nil {
} else { log.Error("failed to GetBlobContent for %q profile (view as %q) readme: %v", ctx.ContextUser.Name, viewAs, err)
ctx.Data["ProfileReadmeContent"] = profileContent return false
}
} }
ctx.Data["IsViewingOrgAsMember"] = viewAsMember
return true return true
} }

View File

@ -54,9 +54,9 @@ func Members(ctx *context.Context) {
return return
} }
err = shared_user.RenderOrgHeader(ctx) _, err = shared_user.PrepareOrgHeader(ctx)
if err != nil { if err != nil {
ctx.ServerError("RenderOrgHeader", err) ctx.ServerError("PrepareOrgHeader", err)
return return
} }

View File

@ -58,9 +58,9 @@ func Teams(ctx *context.Context) {
} }
ctx.Data["Teams"] = ctx.Org.Teams ctx.Data["Teams"] = ctx.Org.Teams
err := shared_user.RenderOrgHeader(ctx) _, err := shared_user.PrepareOrgHeader(ctx)
if err != nil { if err != nil {
ctx.ServerError("RenderOrgHeader", err) ctx.ServerError("PrepareOrgHeader", err)
return return
} }

View File

@ -142,7 +142,7 @@ func RenderUserHeader(ctx *context.Context) {
prepareContextForCommonProfile(ctx) prepareContextForCommonProfile(ctx)
_, profileReadmeBlob := FindOwnerProfileReadme(ctx, ctx.Doer) _, profileReadmeBlob := FindOwnerProfileReadme(ctx, ctx.Doer)
ctx.Data["HasPublicProfileReadme"] = profileReadmeBlob != nil ctx.Data["HasUserProfileReadme"] = profileReadmeBlob != nil
} }
func LoadHeaderCount(ctx *context.Context) error { func LoadHeaderCount(ctx *context.Context) error {
@ -184,18 +184,24 @@ const (
RepoNameProfile = ".profile" RepoNameProfile = ".profile"
) )
func RenderOrgHeader(ctx *context.Context) error { type PrepareOrgHeaderResult struct {
if err := LoadHeaderCount(ctx); err != nil { ProfilePublicRepo *repo_model.Repository
return err ProfilePublicReadmeBlob *git.Blob
ProfilePrivateRepo *repo_model.Repository
ProfilePrivateReadmeBlob *git.Blob
HasOrgProfileReadme bool
}
func PrepareOrgHeader(ctx *context.Context) (result *PrepareOrgHeaderResult, err error) {
if err = LoadHeaderCount(ctx); err != nil {
return nil, err
} }
// FIXME: only do database query, do not open it result = &PrepareOrgHeaderResult{}
_, profileReadmeBlob := FindOwnerProfileReadme(ctx, ctx.Doer) result.ProfilePublicRepo, result.ProfilePublicReadmeBlob = FindOwnerProfileReadme(ctx, ctx.Doer)
ctx.Data["HasPublicProfileReadme"] = profileReadmeBlob != nil result.ProfilePrivateRepo, result.ProfilePrivateReadmeBlob = FindOwnerProfileReadme(ctx, ctx.Doer, RepoNameProfilePrivate)
result.HasOrgProfileReadme = result.ProfilePublicReadmeBlob != nil || result.ProfilePrivateReadmeBlob != nil
// FIXME: only do database query, do not open it ctx.Data["HasOrgProfileReadme"] = result.HasOrgProfileReadme // many pages need it to show the "overview" tab
_, profileReadmeBlob = FindOwnerProfileReadme(ctx, ctx.Doer, RepoNameProfilePrivate) ctx.Data["ShowOrgProfileReadmeSelector"] = result.ProfilePublicReadmeBlob != nil && result.ProfilePrivateReadmeBlob != nil
ctx.Data["HasPrivateProfileReadme"] = profileReadmeBlob != nil return result, nil
return nil
} }

View File

@ -95,7 +95,7 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb
} }
} }
ctx.Data["TabName"] = tab ctx.Data["TabName"] = tab
ctx.Data["HasPublicProfileReadme"] = profileReadme != nil ctx.Data["HasUserProfileReadme"] = profileReadme != nil
page := ctx.FormInt("page") page := ctx.FormInt("page")
if page <= 0 { if page <= 0 {

View File

@ -6,7 +6,7 @@
<div class="ui mobile reversed stackable grid"> <div class="ui mobile reversed stackable grid">
<div class="ui {{if .ShowMemberAndTeamTab}}eleven wide{{end}} column"> <div class="ui {{if .ShowMemberAndTeamTab}}eleven wide{{end}} column">
{{if .ProfileReadmeContent}} {{if .ProfileReadmeContent}}
<div id="readme_profile" class="markup">{{.ProfileReadmeContent}}</div> <div id="readme_profile" class="markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
{{end}} {{end}}
{{template "shared/repo_search" .}} {{template "shared/repo_search" .}}
{{template "explore/repo_list" .}} {{template "explore/repo_list" .}}
@ -25,26 +25,26 @@
<div class="divider"></div> <div class="divider"></div>
{{end}} {{end}}
{{if and .ShowMemberAndTeamTab .HasPublicProfileReadme .HasPrivateProfileReadme}} {{if and .ShowMemberAndTeamTab .ShowOrgProfileReadmeSelector}}
<div class="tw-my-4"> <div class="tw-my-4">
<div id="org-home-view-as-dropdown" class="ui dropdown jump"> <div id="org-home-view-as-dropdown" class="ui dropdown jump">
<span class="text"> <span class="text">
{{svg "octicon-eye"}} {{svg "octicon-eye"}}
View as: {{if not .IsViewerMember}}{{ctx.Locale.Tr "settings.visibility.public"}}{{else}}{{ctx.Locale.Tr "org.members.member"}}{{end}} View as: {{if not .IsViewingOrgAsMember}}{{ctx.Locale.Tr "settings.visibility.public"}}{{else}}{{ctx.Locale.Tr "org.members.member"}}{{end}}
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu"> <div class="menu">
{{/* TODO: does it really need to use CurrentURL with query parameters? Why not construct a new link with clear parameters */}} {{/* TODO: does it really need to use CurrentURL with query parameters? Why not construct a new link with clear parameters */}}
<a href="{{QueryBuild $.CurrentURL "view_as" "public"}}" class="item {{if not .IsViewerMember}}selected{{end}}"> <a href="{{QueryBuild $.CurrentURL "view_as" "public"}}" class="item {{if not .IsViewingOrgAsMember}}selected{{end}}">
{{svg "octicon-check" 14 (Iif (not .IsViewerMember) "" "tw-invisible")}} {{ctx.Locale.Tr "settings.visibility.public"}} {{svg "octicon-check" 14 (Iif (not .IsViewingOrgAsMember) "" "tw-invisible")}} {{ctx.Locale.Tr "settings.visibility.public"}}
</a> </a>
<a href="{{QueryBuild $.CurrentURL "view_as" "member"}}" class="item {{if .IsViewerMember}}selected{{end}}"> <a href="{{QueryBuild $.CurrentURL "view_as" "member"}}" class="item {{if .IsViewingOrgAsMember}}selected{{end}}">
{{svg "octicon-check" 14 (Iif .IsViewerMember "" "tw-invisible")}} {{ctx.Locale.Tr "org.members.member"}} {{svg "octicon-check" 14 (Iif .IsViewingOrgAsMember "" "tw-invisible")}} {{ctx.Locale.Tr "org.members.member"}}
</a> </a>
</div> </div>
</div> </div>
<div class="tw-my-2"> <div class="tw-my-2">
{{if .IsViewerMember}}{{ctx.Locale.Tr "org.view_as_member_hint"}}{{else}}{{ctx.Locale.Tr "org.view_as_public_hint"}}{{end}} {{if .IsViewingOrgAsMember}}{{ctx.Locale.Tr "org.view_as_member_hint"}}{{else}}{{ctx.Locale.Tr "org.view_as_public_hint"}}{{end}}
</div> </div>
</div> </div>
{{end}} {{end}}

View File

@ -1,12 +1,12 @@
<div class="ui container"> <div class="ui container">
<overflow-menu class="ui secondary pointing tabular borderless menu tw-mb-4"> <overflow-menu class="ui secondary pointing tabular borderless menu tw-mb-4">
<div class="overflow-menu-items"> <div class="overflow-menu-items">
{{if or .HasPublicProfileReadme .HasPrivateProfileReadme}} {{if .HasOrgProfileReadme}}
<a class="{{if .PageIsViewOverview}}active {{end}}item" href="{{$.Org.HomeLink}}"> <a class="{{if .PageIsViewOverview}}active {{end}}item" href="{{$.Org.HomeLink}}">
{{svg "octicon-info"}} {{ctx.Locale.Tr "user.overview"}} {{svg "octicon-info"}} {{ctx.Locale.Tr "user.overview"}}
</a> </a>
{{end}} {{end}}
<a class="{{if .PageIsViewRepositories}}active {{end}}item" href="{{$.Org.HomeLink}}{{if or .HasPublicProfileReadme .HasPrivateProfileReadme}}/-/repositories{{end}}"> <a class="{{if .PageIsViewRepositories}}active {{end}}item" href="{{$.Org.HomeLink}}{{if .HasOrgProfileReadme}}/-/repositories{{end}}">
{{svg "octicon-repo"}} {{ctx.Locale.Tr "user.repositories"}} {{svg "octicon-repo"}} {{ctx.Locale.Tr "user.repositories"}}
{{if .RepoCount}} {{if .RepoCount}}
<div class="ui small label">{{.RepoCount}}</div> <div class="ui small label">{{.RepoCount}}</div>

View File

@ -1,6 +1,6 @@
<overflow-menu class="ui secondary pointing tabular borderless menu"> <overflow-menu class="ui secondary pointing tabular borderless menu">
<div class="overflow-menu-items"> <div class="overflow-menu-items">
{{if and .HasPublicProfileReadme .ContextUser.IsIndividual}} {{if and .HasUserProfileReadme .ContextUser.IsIndividual}}
<a class="{{if eq .TabName "overview"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=overview"> <a class="{{if eq .TabName "overview"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=overview">
{{svg "octicon-info"}} {{ctx.Locale.Tr "user.overview"}} {{svg "octicon-info"}} {{ctx.Locale.Tr "user.overview"}}
</a> </a>

View File

@ -69,7 +69,7 @@ func testOrgProfile(t *testing.T, u *url.URL) {
resp := MakeRequest(t, req, http.StatusOK) resp := MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
profileDivs := htmlDoc.doc.Find("#user-content-public") profileDivs := htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
dropDownDiv := htmlDoc.doc.Find("#org-home-view-as-dropdown") dropDownDiv := htmlDoc.doc.Find("#org-home-view-as-dropdown")
@ -81,7 +81,7 @@ func testOrgProfile(t *testing.T, u *url.URL) {
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-public") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown") dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown")
@ -93,7 +93,7 @@ func testOrgProfile(t *testing.T, u *url.URL) {
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-public") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown") dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown")
@ -103,14 +103,14 @@ func testOrgProfile(t *testing.T, u *url.URL) {
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-private") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=true]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
req = NewRequest(t, "GET", "/org3?view_as=public") req = NewRequest(t, "GET", "/org3?view_as=public")
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-public") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
// PART 2: Each org has either one of private pr public profile // PART 2: Each org has either one of private pr public profile
@ -121,7 +121,7 @@ func testOrgProfile(t *testing.T, u *url.URL) {
req = NewRequest(t, "GET", "/org41") req = NewRequest(t, "GET", "/org41")
resp = MakeRequest(t, req, http.StatusOK) resp = MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-public") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown") dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown")
assert.EqualValues(t, 0, dropDownDiv.Length()) assert.EqualValues(t, 0, dropDownDiv.Length())
@ -129,9 +129,9 @@ func testOrgProfile(t *testing.T, u *url.URL) {
req = NewRequest(t, "GET", "/org42") req = NewRequest(t, "GET", "/org42")
resp = MakeRequest(t, req, http.StatusOK) resp = MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-public") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 0, profileDivs.Length()) assert.EqualValues(t, 0, profileDivs.Length())
profileDivs = htmlDoc.doc.Find("#user-content-public") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 0, profileDivs.Length()) assert.EqualValues(t, 0, profileDivs.Length())
dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown") dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown")
assert.EqualValues(t, 0, dropDownDiv.Length()) assert.EqualValues(t, 0, dropDownDiv.Length())
@ -140,7 +140,7 @@ func testOrgProfile(t *testing.T, u *url.URL) {
req = NewRequest(t, "GET", "/org41") req = NewRequest(t, "GET", "/org41")
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-public") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=false]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown") dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown")
assert.EqualValues(t, 0, dropDownDiv.Length()) assert.EqualValues(t, 0, dropDownDiv.Length())
@ -148,7 +148,7 @@ func testOrgProfile(t *testing.T, u *url.URL) {
req = NewRequest(t, "GET", "/org42") req = NewRequest(t, "GET", "/org42")
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
profileDivs = htmlDoc.doc.Find("#user-content-private") profileDivs = htmlDoc.doc.Find("[data-profile-view-as-member=true]")
assert.EqualValues(t, 1, profileDivs.Length()) assert.EqualValues(t, 1, profileDivs.Length())
dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown") dropDownDiv = htmlDoc.doc.Find("#org-home-view-as-dropdown")
assert.EqualValues(t, 0, dropDownDiv.Length()) assert.EqualValues(t, 0, dropDownDiv.Length())