1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 02:08:36 +00:00

Use lfs label for lfs file rather than a long description (#34363)

Before


![image](https://github.com/user-attachments/assets/ed6c9221-5a6a-4717-8178-e5528fd180bf)

After


![image](https://github.com/user-attachments/assets/baa94350-ead4-46bf-b4b7-1bfd3aa5dcac)
This commit is contained in:
Lunny Xiao
2025-05-04 14:07:29 -07:00
committed by GitHub
parent 51aafb4278
commit 62f73491f3
4 changed files with 5 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ func TestLFSRender(t *testing.T) {
doc := NewHTMLParser(t, resp.Body).doc
fileInfo := doc.Find("div.file-info-entry").First().Text()
assert.Contains(t, fileInfo, "Stored with Git LFS")
assert.Contains(t, fileInfo, "LFS")
content := doc.Find("div.file-view").Text()
assert.Contains(t, content, "Testing documents in LFS")
@@ -54,7 +54,7 @@ func TestLFSRender(t *testing.T) {
doc := NewHTMLParser(t, resp.Body).doc
fileInfo := doc.Find("div.file-info-entry").First().Text()
assert.Contains(t, fileInfo, "Stored with Git LFS")
assert.Contains(t, fileInfo, "LFS")
src, exists := doc.Find(".file-view img").Attr("src")
assert.True(t, exists, "The image should be in an <img> tag")
@@ -71,7 +71,7 @@ func TestLFSRender(t *testing.T) {
doc := NewHTMLParser(t, resp.Body).doc
fileInfo := doc.Find("div.file-info-entry").First().Text()
assert.Contains(t, fileInfo, "Stored with Git LFS")
assert.Contains(t, fileInfo, "LFS")
rawLink, exists := doc.Find("div.file-view > div.view-raw > a").Attr("href")
assert.True(t, exists, "Download link should render instead of content because this is a binary file")