mirror of
https://github.com/kovetskiy/mark.git
synced 2026-01-22 10:47:36 +08:00
Update link_test.go
This commit is contained in:
parent
b4370c09c6
commit
0a821fb1c5
@ -54,18 +54,13 @@ func TestParseLinks(t *testing.T) {
|
|||||||
|
|
||||||
func TestNormalizeConfluenceWebUIPath(t *testing.T) {
|
func TestNormalizeConfluenceWebUIPath(t *testing.T) {
|
||||||
t.Run("confluence-cloud-experience-prefix", func(t *testing.T) {
|
t.Run("confluence-cloud-experience-prefix", func(t *testing.T) {
|
||||||
input := "/ex/confluence/05594958-6d5d-4e00-9017-90926d8b82d5/wiki/spaces/DVT/pages/5645697027/DX"
|
input := "/ex/confluence/05532958-2d1d-4f01-2027-90926d8b54d5/wiki/spaces/MySpace/pages/2441299827/TEST"
|
||||||
expected := "/wiki/spaces/DVT/pages/5645697027/DX"
|
expected := "/wiki/spaces/MySpace/pages/2441299827/TEST"
|
||||||
assert.Equal(t, expected, normalizeConfluenceWebUIPath(input))
|
assert.Equal(t, expected, normalizeConfluenceWebUIPath(input))
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("already-canonical-wiki", func(t *testing.T) {
|
t.Run("already-canonical-wiki", func(t *testing.T) {
|
||||||
input := "/wiki/spaces/DVT/pages/5645697027/DX"
|
input := "/wiki/spaces/MySpace/pages/2441299827/TEST"
|
||||||
assert.Equal(t, input, normalizeConfluenceWebUIPath(input))
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("local-relative-path-unchanged", func(t *testing.T) {
|
|
||||||
input := "./img/some-nice-image.png"
|
|
||||||
assert.Equal(t, input, normalizeConfluenceWebUIPath(input))
|
assert.Equal(t, input, normalizeConfluenceWebUIPath(input))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user