more features
Some checks failed
CI/CD Pipeline / Lint (pull_request) Has been cancelled
CI/CD Pipeline / Test (pull_request) Has been cancelled
CI/CD Pipeline / Build (386, linux, linkbeam-linux-386) (pull_request) Has been cancelled
CI/CD Pipeline / Build (386, windows, linkbeam-windows-386.exe) (pull_request) Has been cancelled
CI/CD Pipeline / Build (amd64, darwin, linkbeam-darwin-amd64) (pull_request) Has been cancelled
CI/CD Pipeline / Build (amd64, linux, linkbeam-linux-amd64) (pull_request) Has been cancelled
CI/CD Pipeline / Build (amd64, windows, linkbeam-windows-amd64.exe) (pull_request) Has been cancelled
CI/CD Pipeline / Build (arm, 7, linux, linkbeam-linux-armv7) (pull_request) Has been cancelled
CI/CD Pipeline / Build (arm64, darwin, linkbeam-darwin-arm64) (pull_request) Has been cancelled
CI/CD Pipeline / Build (arm64, linux, linkbeam-linux-arm64) (pull_request) Has been cancelled
CI/CD Pipeline / Build (arm64, windows, linkbeam-windows-arm64.exe) (pull_request) Has been cancelled
CI/CD Pipeline / Build Docker Image (pull_request) Has been cancelled
CI/CD Pipeline / Create Release (pull_request) Has been cancelled

This commit is contained in:
2025-11-16 13:16:22 +04:00
parent 1b95db4ab5
commit 3421275d37
17 changed files with 935 additions and 184 deletions

View File

@@ -23,6 +23,49 @@ func TestValidateConfig(t *testing.T) {
{"missing name", Config{Name: "", Theme: "auto"}, true},
{"valid config", Config{Name: "Ada", Theme: "auto"}, false},
{"valid config with any theme", Config{Name: "Ada", Theme: "invalid"}, false}, // No theme validation without themesDir
{
name: "valid content blocks",
cfg: Config{
Name: "Test",
Theme: "auto",
Content: []ContentBlock{
{
Type: "vertical-list-text",
Collections: map[string][]Item{
"links": {{Title: "Test", URL: "https://test.com"}},
},
},
},
},
wantError: false,
},
{
name: "invalid block type",
cfg: Config{
Name: "Test",
Theme: "auto",
Content: []ContentBlock{
{Type: "invalid-type"},
},
},
wantError: true,
},
{
name: "item without content",
cfg: Config{
Name: "Test",
Theme: "auto",
Content: []ContentBlock{
{
Type: "vertical-list-text",
Collections: map[string][]Item{
"links": {{Title: "Empty"}}, // No url, copy-text, or text
},
},
},
},
wantError: true,
},
}
for _, tt := range tests {