Skip to content

Commit

Permalink
Add addtional check for 404 images
Browse files Browse the repository at this point in the history
Testing out re issue #207
  • Loading branch information
wjdp committed Jan 28, 2023
1 parent 11794c5 commit 078245d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion htmltest/check-img_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ func TestImageExternalMissing(t *testing.T) {
map[string]interface{}{"VCREnable": true})
tExpectIssueCount(t, hT, 1)
// Issue contains "no such host"
// tExpectIssue(t, hT, "no such host", 1)
tExpectIssue(t, hT, "no such host", 1)
}

func TestImageExternal404(t *testing.T) {
// fails for missing external images
hT := tTestFileOpts("fixtures/images/imageExternal404.html",
map[string]interface{}{"VCREnable": true})
tExpectIssueCount(t, hT, 1)
// Issue contains "no such host"
tExpectIssue(t, hT, "Non-OK status: 404", 1)
}

func TestImageExternalMissingProtocolValid(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions htmltest/fixtures/images/imageExternal404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>

<body>

<p>Blah blah blah. <img alt="A src that'll return 404" src="https://upload.wikimedia.org/wikipedia/en/404" /> </p>

</body>

</html>

0 comments on commit 078245d

Please sign in to comment.