Skip to content

Commit 2e80917

Browse files
committed
fix tests error
1 parent 448effb commit 2e80917

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/integration/lfs_view_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,14 @@ func TestLFSRender(t *testing.T) {
7373
fileInfo := doc.Find("div.file-info-entry").First().Text()
7474
assert.Contains(t, fileInfo, "LFS")
7575

76-
rawLink, exists := doc.Find("div.file-view > div.view-raw > a").Attr("href")
77-
assert.True(t, exists, "Download link should render instead of content because this is a binary file")
78-
assert.Equal(t, "/user2/lfs/media/branch/master/crypt.bin", rawLink, "The download link should use the proper /media link because it's in LFS")
76+
// find new file view container
77+
fileViewContainer := doc.Find("div.file-view-container")
78+
assert.Positive(t, fileViewContainer.Length(), "File view container should exist")
79+
80+
// check data attribute instead of link href
81+
dataURL, exists := fileViewContainer.Attr("data-url")
82+
assert.True(t, exists, "File view container should have data-url attribute")
83+
assert.Equal(t, "/user2/lfs/media/branch/master/crypt.bin", dataURL, "The data-url should use the proper /media link because it's in LFS")
7984
})
8085

8186
// check that a directory with a README file shows its text

0 commit comments

Comments
 (0)