mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
feat(ui): dedicated icon for CITATION file (#10873)
Fix forgejo/forgejo#7864 Screenshot: https://codeberg.org/attachments/62fbd43e-fe08-45dd-97a6-224353fd94a9 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10873 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: oliverpool <git@olivier.pfad.fr> Co-committed-by: oliverpool <git@olivier.pfad.fr>
This commit is contained in:
parent
a2462adca0
commit
fdf4dfd2a5
4 changed files with 29 additions and 6 deletions
|
|
@ -188,6 +188,11 @@ func TestRepoViewFileLines(t *testing.T) {
|
|||
TreePath: "seemingly-empty",
|
||||
ContentReader: strings.NewReader("\n"),
|
||||
},
|
||||
{
|
||||
Operation: "create",
|
||||
TreePath: "CITATION.cff",
|
||||
ContentReader: strings.NewReader(""),
|
||||
},
|
||||
})
|
||||
defer f()
|
||||
|
||||
|
|
@ -220,5 +225,18 @@ func TestRepoViewFileLines(t *testing.T) {
|
|||
testEOL(t, "empty", true)
|
||||
testEOL(t, "seemingly-empty", true)
|
||||
})
|
||||
t.Run("list", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
req := NewRequest(t, "GET", repo.Link())
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
|
||||
nodes := htmlDoc.Find("#repo-files-table tr")
|
||||
t.Run("CITATION.cff", func(t *testing.T) {
|
||||
c, ok := nodes.Find(`.name a[title="CITATION.cff"] svg`).Attr("class")
|
||||
assert.True(t, ok, "could not find CITATION.cff line")
|
||||
assert.Contains(t, c, "octicon-cross-reference")
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue