mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
chore(chromium): add test without custom header/footer templates
This commit is contained in:
@@ -435,7 +435,7 @@ func TestChromium_PDF(t *testing.T) {
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "with a lot of options",
|
||||
name: "with a lot of properties",
|
||||
timeout: time.Duration(60) * time.Second,
|
||||
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
|
||||
userAgent: "foo",
|
||||
@@ -487,6 +487,47 @@ func TestChromium_PDF(t *testing.T) {
|
||||
}(),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with custom header template only",
|
||||
timeout: time.Duration(60) * time.Second,
|
||||
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
|
||||
options: Options{
|
||||
HeaderTemplate: func() string {
|
||||
b, err := os.ReadFile("/tests/test/testdata/chromium/url/sample2/header.html")
|
||||
if err != nil {
|
||||
t.Fatalf("expected no error but got: %v", err)
|
||||
}
|
||||
|
||||
return string(b)
|
||||
}(),
|
||||
FooterTemplate: DefaultOptions().FooterTemplate,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with custom footer template only",
|
||||
timeout: time.Duration(60) * time.Second,
|
||||
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
|
||||
options: Options{
|
||||
HeaderTemplate: DefaultOptions().HeaderTemplate,
|
||||
FooterTemplate: func() string {
|
||||
b, err := os.ReadFile("/tests/test/testdata/chromium/url/sample2/footer.html")
|
||||
if err != nil {
|
||||
t.Fatalf("expected no error but got: %v", err)
|
||||
}
|
||||
|
||||
return string(b)
|
||||
}(),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "without custom header and footer templates",
|
||||
timeout: time.Duration(60) * time.Second,
|
||||
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
|
||||
options: Options{
|
||||
HeaderTemplate: DefaultOptions().HeaderTemplate,
|
||||
FooterTemplate: DefaultOptions().FooterTemplate,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with file using a .gif",
|
||||
timeout: time.Duration(60) * time.Second,
|
||||
|
||||
Reference in New Issue
Block a user