Add conflict resolution diff UI and app branding
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/tim/md-hub-secure/apps/server/internal/docs"
|
||||
"github.com/tim/cairnquire/apps/server/internal/docs"
|
||||
)
|
||||
|
||||
func TestBuildBrowserUsesFolderIndex(t *testing.T) {
|
||||
@@ -41,3 +41,25 @@ func TestBuildBrowserUsesFolderIndex(t *testing.T) {
|
||||
t.Fatalf("folder index file should be represented by the folder, not repeated as a child file")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrimEditSuffix(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
wantPath string
|
||||
wantOK bool
|
||||
}{
|
||||
{name: "nested path", input: "guide/setup/edit", wantPath: "guide/setup", wantOK: true},
|
||||
{name: "root edit sentinel", input: "edit", wantPath: "", wantOK: true},
|
||||
{name: "document route", input: "guide/setup", wantPath: "", wantOK: false},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
gotPath, gotOK := trimEditSuffix(tt.input)
|
||||
if gotPath != tt.wantPath || gotOK != tt.wantOK {
|
||||
t.Fatalf("trimEditSuffix(%q) = (%q, %t), want (%q, %t)", tt.input, gotPath, gotOK, tt.wantPath, tt.wantOK)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user