🧑‍💻 Updated test site constructor, added logo/photo resources

This commit is contained in:
Maxim Lebedev 2024-02-14 12:09:31 +06:00
parent a013c3a3fa
commit d84563a515
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 26 additions and 2 deletions

View File

@ -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{