Skip to content

Commit 08c74a9

Browse files
committed
Add .branch-name for reliable selector in divergence test
1 parent fa4cf91 commit 08c74a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/repo/branch/list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<tr>
2121
<td>
2222
<div class="flex-text-block">
23-
<a class="gt-ellipsis" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a>
23+
<a class="gt-ellipsis branch-name" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a>
2424
{{if .DefaultBranchBranch.IsProtected}}
2525
<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span>
2626
{{end}}
@@ -90,13 +90,13 @@
9090
<td class="eight wide">
9191
{{if .DBBranch.IsDeleted}}
9292
<div class="flex-text-block">
93-
<span class="gt-ellipsis">{{.DBBranch.Name}}</span>
93+
<span class="gt-ellipsis branch-name">{{.DBBranch.Name}}</span>
9494
<button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button>
9595
</div>
9696
<p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{DateUtils.TimeSince .DBBranch.DeletedUnix}}</p>
9797
{{else}}
9898
<div class="flex-text-block">
99-
<a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a>
99+
<a class="gt-ellipsis branch-name" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a>
100100
{{if .IsProtected}}
101101
<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span>
102102
{{end}}

tests/integration/change_default_branch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func checkDivergence(t *testing.T, session *TestSession, branchesURL, expectedDe
4949

5050
htmlDoc := NewHTMLParser(t, resp.Body)
5151

52-
branchNodes := htmlDoc.doc.Find(".gt-ellipsis").Nodes
52+
branchNodes := htmlDoc.doc.Find(".branch-name").Nodes
5353
branchNames := []string{}
5454
for _, node := range branchNodes {
5555
branchNames = append(branchNames, node.FirstChild.Data)

0 commit comments

Comments
 (0)