fix: resolve link space inheritance and enhance Confluence URL normalization tests

Signed-off-by: Nikolai Emil Damm <ndam@tv2.dk>
This commit is contained in:
Nikolai Emil Damm
2025-12-19 12:34:29 +01:00
committed by Manuel Rüger
parent 0dd5ea9aee
commit ef560d095c
2 changed files with 59 additions and 22 deletions

View File

@@ -54,13 +54,13 @@ func TestParseLinks(t *testing.T) {
func TestNormalizeConfluenceWebUIPath(t *testing.T) {
t.Run("confluence-cloud-experience-prefix", func(t *testing.T) {
input := "/ex/confluence/05532958-2d1d-4f01-2027-90926d8b54d5/wiki/spaces/MySpace/pages/2441299827/TEST"
expected := "/wiki/spaces/MySpace/pages/2441299827/TEST"
input := "/ex/confluence/cloud-id/wiki/spaces/SPACE/pages/12345/PageName"
expected := "/wiki/spaces/SPACE/pages/12345/PageName"
assert.Equal(t, expected, normalizeConfluenceWebUIPath(input))
})
t.Run("already-canonical-wiki", func(t *testing.T) {
input := "/wiki/spaces/MySpace/pages/2441299827/TEST"
input := "/wiki/spaces/SPACE/pages/12345/PageName"
assert.Equal(t, input, normalizeConfluenceWebUIPath(input))
})
}