|
|
|
|
@@ -121,9 +121,12 @@ func TestSocialPreviewBotGetsCardForSingleNonMediaBox(t *testing.T) {
|
|
|
|
|
t.Fatalf("status = %d, body = %s", response.Code, response.Body.String())
|
|
|
|
|
}
|
|
|
|
|
body := response.Body.String()
|
|
|
|
|
if !strings.Contains(body, `property="og:image" content="http://example.test/d/`+payload.BoxID+`/f/`+payload.Files[0].ID+`/og-image.jpg"`) {
|
|
|
|
|
if !strings.Contains(body, `/d/`+payload.BoxID+`/f/`+payload.Files[0].ID+`/og-image.jpg"`) {
|
|
|
|
|
t.Fatalf("social preview bot did not receive file card metadata: %s", body)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(body, `class="file-thumb" src="/d/`+payload.BoxID+`/thumb/`+payload.Files[0].ID+`"`) {
|
|
|
|
|
t.Fatalf("download page did not render text thumbnail image: %s", body)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(body, "Click to preview or download") && !strings.Contains(body, "click to preview or download") {
|
|
|
|
|
t.Fatalf("social preview body missing preview/download description: %s", body)
|
|
|
|
|
}
|
|
|
|
|
@@ -145,7 +148,7 @@ func TestSocialPreviewBotGetsCardForNonMediaFilePreview(t *testing.T) {
|
|
|
|
|
t.Fatalf("status = %d, body = %s", response.Code, response.Body.String())
|
|
|
|
|
}
|
|
|
|
|
body := response.Body.String()
|
|
|
|
|
if !strings.Contains(body, `property="og:image" content="http://example.test/d/`+payload.BoxID+`/f/`+payload.Files[0].ID+`/og-image.jpg"`) {
|
|
|
|
|
if !strings.Contains(body, `/d/`+payload.BoxID+`/f/`+payload.Files[0].ID+`/og-image.jpg"`) {
|
|
|
|
|
t.Fatalf("social preview bot did not receive file card metadata: %s", body)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(body, `name="twitter:card" content="summary_large_image"`) {
|
|
|
|
|
|