Merge branch 'main' of github.com:mikestefanello/pagoda into main

This commit is contained in:
mikestefanello 2023-09-17 11:38:26 -04:00
commit 68b850c87b
2 changed files with 4 additions and 5 deletions

View file

@ -2,7 +2,6 @@ package controller
import ( import (
"context" "context"
"io/ioutil"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"os" "os"
@ -99,7 +98,7 @@ func TestController_RenderPage(t *testing.T) {
expectedTemplates := make(map[string]bool) expectedTemplates := make(map[string]bool)
expectedTemplates[p.Name+config.TemplateExt] = true expectedTemplates[p.Name+config.TemplateExt] = true
expectedTemplates[p.Layout+config.TemplateExt] = true expectedTemplates[p.Layout+config.TemplateExt] = true
components, err := ioutil.ReadDir(c.TemplateRenderer.GetTemplatesPath() + "/components") components, err := os.ReadDir(c.TemplateRenderer.GetTemplatesPath() + "/components")
require.NoError(t, err) require.NoError(t, err)
for _, f := range components { for _, f := range components {
expectedTemplates[f.Name()] = true expectedTemplates[f.Name()] = true
@ -132,7 +131,7 @@ func TestController_RenderPage(t *testing.T) {
expectedTemplates := make(map[string]bool) expectedTemplates := make(map[string]bool)
expectedTemplates[p.Name+config.TemplateExt] = true expectedTemplates[p.Name+config.TemplateExt] = true
expectedTemplates["htmx"+config.TemplateExt] = true expectedTemplates["htmx"+config.TemplateExt] = true
components, err := ioutil.ReadDir(c.TemplateRenderer.GetTemplatesPath() + "/components") components, err := os.ReadDir(c.TemplateRenderer.GetTemplatesPath() + "/components")
require.NoError(t, err) require.NoError(t, err)
for _, f := range components { for _, f := range components {
expectedTemplates[f.Name()] = true expectedTemplates[f.Name()] = true

View file

@ -1,7 +1,7 @@
package services package services
import ( import (
"io/ioutil" "os"
"testing" "testing"
"github.com/mikestefanello/pagoda/config" "github.com/mikestefanello/pagoda/config"
@ -37,7 +37,7 @@ func TestTemplateRenderer(t *testing.T) {
expectedTemplates := make(map[string]bool) expectedTemplates := make(map[string]bool)
expectedTemplates["htmx"+config.TemplateExt] = true expectedTemplates["htmx"+config.TemplateExt] = true
expectedTemplates["error"+config.TemplateExt] = true expectedTemplates["error"+config.TemplateExt] = true
components, err := ioutil.ReadDir(c.TemplateRenderer.GetTemplatesPath() + "/components") components, err := os.ReadDir(c.TemplateRenderer.GetTemplatesPath() + "/components")
require.NoError(t, err) require.NoError(t, err)
for _, f := range components { for _, f := range components {
expectedTemplates[f.Name()] = true expectedTemplates[f.Name()] = true