This commit is contained in:
parent
d2205b11a7
commit
02b9aebbe5
341 changed files with 1571 additions and 32574 deletions
|
|
@ -6,9 +6,9 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TecharoHQ/anubis"
|
||||
"github.com/TecharoHQ/anubis/lib/config"
|
||||
"github.com/TecharoHQ/anubis/lib/localization"
|
||||
"git.sad.ovh/sophie/nuke"
|
||||
"git.sad.ovh/sophie/nuke/lib/config"
|
||||
"git.sad.ovh/sophie/nuke/lib/localization"
|
||||
"github.com/a-h/templ"
|
||||
)
|
||||
|
||||
|
|
@ -21,27 +21,27 @@ func TestBasePrefixInLinks(t *testing.T) {
|
|||
{
|
||||
name: "no prefix",
|
||||
basePrefix: "",
|
||||
wantInLink: "/.within.website/x/cmd/anubis/api/",
|
||||
wantInLink: "/.within.website/x/cmd/nuke/api/",
|
||||
},
|
||||
{
|
||||
name: "with rififi prefix",
|
||||
basePrefix: "/rififi",
|
||||
wantInLink: "/rififi/.within.website/x/cmd/anubis/api/",
|
||||
wantInLink: "/rififi/.within.website/x/cmd/nuke/api/",
|
||||
},
|
||||
{
|
||||
name: "with myapp prefix",
|
||||
basePrefix: "/myapp",
|
||||
wantInLink: "/myapp/.within.website/x/cmd/anubis/api/",
|
||||
wantInLink: "/myapp/.within.website/x/cmd/nuke/api/",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Save original BasePrefix and restore after test
|
||||
origPrefix := anubis.BasePrefix
|
||||
defer func() { anubis.BasePrefix = origPrefix }()
|
||||
origPrefix := nuke.BasePrefix
|
||||
defer func() { nuke.BasePrefix = origPrefix }()
|
||||
|
||||
anubis.BasePrefix = tt.basePrefix
|
||||
nuke.BasePrefix = tt.basePrefix
|
||||
|
||||
// Create test impressum
|
||||
impressum := &config.Impressum{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue