fix tests

This commit is contained in:
nkanaev
2026-07-10 18:41:26 +01:00
parent 8fc914448b
commit 8e05b515c8
2 changed files with 5 additions and 4 deletions

View File

@@ -15,9 +15,10 @@ var static embed.FS
var templates embed.FS
func Templates() *template.Template {
return template.Must(template.ParseFS(templates, "*.html"))
return template.Must(template.ParseFS(templates, "templates/*.html"))
}
func StaticFS() fs.FS {
return static
fs, _ := fs.Sub(static, "static")
return fs
}

View File

@@ -16,7 +16,7 @@ import (
func TestStatic(t *testing.T) {
handler := NewServer(nil, "127.0.0.1:8000").handler()
url := "/static/javascripts/app.js"
url := "/static/bundle.js"
recorder := httptest.NewRecorder()
request := httptest.NewRequest("GET", url, nil)
@@ -31,7 +31,7 @@ func TestStaticWithBase(t *testing.T) {
server.BasePath = "/sub"
handler := server.handler()
url := "/sub/static/javascripts/app.js"
url := "/sub/static/bundle.js"
recorder := httptest.NewRecorder()
request := httptest.NewRequest("GET", url, nil)