mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-27 00:23:41 +09:00
Backport #35679 by surya-purohit shows the main LFS filesize instead of the pointer filesize when viewing a file Co-authored-by: Surya Purohit <suryaprakash.sharma@sourcefuse.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -72,6 +72,8 @@ func TestLFSRender(t *testing.T) {
|
||||
|
||||
fileInfo := doc.Find("div.file-info-entry").First().Text()
|
||||
assert.Contains(t, fileInfo, "LFS")
|
||||
fileSize := doc.Find("div.file-info-entry > .file-info-size").Text()
|
||||
assert.Equal(t, "2.0 KiB", fileSize)
|
||||
|
||||
// find new file view container
|
||||
fileViewContainer := doc.Find("[data-global-init=initRepoFileView]")
|
||||
|
||||
@@ -257,10 +257,12 @@ func testViewFileInRepo(t *testing.T) {
|
||||
description := htmlDoc.doc.Find(".repo-description")
|
||||
repoTopics := htmlDoc.doc.Find("#repo-topics")
|
||||
repoSummary := htmlDoc.doc.Find(".repository-summary")
|
||||
fileSize := htmlDoc.Find("div.file-info-entry > .file-info-size").Text()
|
||||
|
||||
assert.Equal(t, 0, description.Length())
|
||||
assert.Equal(t, 0, repoTopics.Length())
|
||||
assert.Equal(t, 0, repoSummary.Length())
|
||||
assert.Equal(t, "30 B", fileSize)
|
||||
}
|
||||
|
||||
// TestBlameFileInRepo repo description, topics and summary should not be displayed when running blame on a file
|
||||
|
||||
Reference in New Issue
Block a user