This commit is contained in:
41666 2025-04-05 22:02:17 -07:00
parent 8c8cbfd7dd
commit 41d48bf60a
28 changed files with 434 additions and 7 deletions

View file

@ -5,9 +5,11 @@ import (
"github.com/gofiber/fiber/v3"
"git.sapphic.engineer/roleypoly/v4/authmiddleware"
"git.sapphic.engineer/roleypoly/v4/auth/authmiddleware"
"git.sapphic.engineer/roleypoly/v4/discord"
"git.sapphic.engineer/roleypoly/v4/presentation"
"git.sapphic.engineer/roleypoly/v4/types"
"git.sapphic.engineer/roleypoly/v4/types/fixtures"
)
type TestingController struct {
@ -34,7 +36,14 @@ func (t *TestingController) Picker(c fiber.Ctx) error {
func (t *TestingController) TestTemplate(c fiber.Ctx) error {
which := c.Params("which")
return c.Render("tests/"+which, fiber.Map{})
cat1 := fixtures.Category(fixtures.CategoryMulti)
cat2 := fixtures.Category(fixtures.CategorySingle)
return c.Render("tests/"+which, fiber.Map{
"TestRole": presentation.Role(cat1, &fixtures.RoleWithDarkColor, false),
"TestRole2": presentation.Role(cat1, &fixtures.RoleWithLightColor, true),
"TestRole3": presentation.Role(cat2, &fixtures.RoleWithDarkColor, false),
"TestRole4": presentation.Role(cat2, &fixtures.RoleWithLightColor, true),
}, "layouts/main")
}
func (t *TestingController) GetMember(c fiber.Ctx) error {