🧑💻 Updated test site constructor, added logo/photo resources
This commit is contained in:
parent
a013c3a3fa
commit
d84563a515
|
@ -1,6 +1,7 @@
|
|||
package domain
|
||||
|
||||
import (
|
||||
"image"
|
||||
"net/url"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
@ -42,11 +43,34 @@ func TestSite(tb testing.TB) *Site {
|
|||
DefaultLanguage: en,
|
||||
Language: ru,
|
||||
Languages: []Language{en, ru},
|
||||
BaseURL: &url.URL{Scheme: "http", Host: "127.0.0.1:3000", Path: "/"},
|
||||
BaseURL: &url.URL{Scheme: "https", Host: "example.com", Path: "/"},
|
||||
TimeZone: time.UTC,
|
||||
File: NewPath(filepath.Join("content", "index.en.md")),
|
||||
Title: "Testing",
|
||||
Resources: make([]*Resource, 0),
|
||||
Resources: []*Resource{
|
||||
{
|
||||
modTime: time.Now().UTC().Add(-1 * time.Hour),
|
||||
params: make(map[string]any),
|
||||
File: NewPath("photo.png"),
|
||||
mediaType: NewMediaType("image/png"),
|
||||
key: "photo",
|
||||
name: "photo",
|
||||
resourceType: ResourceTypeImage,
|
||||
title: "",
|
||||
image: image.Config{},
|
||||
},
|
||||
{
|
||||
modTime: time.Now().UTC().Add(-2 * time.Hour),
|
||||
params: make(map[string]any),
|
||||
File: NewPath("logo.jpg"),
|
||||
mediaType: NewMediaType("image/jpeg"),
|
||||
key: "logo",
|
||||
name: "logo",
|
||||
resourceType: ResourceTypeImage,
|
||||
title: "",
|
||||
image: image.Config{},
|
||||
},
|
||||
},
|
||||
Params: map[string]any{
|
||||
"server": map[string]any{
|
||||
"headers": []any{map[string]any{
|
||||
|
|
Loading…
Reference in New Issue