Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go 1.25) (pull_request) Successful in 21s
Tests / Test (Go stable) (pull_request) Successful in 26s
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
//go:build integration
|
|
|
|
package onlyoffice
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// TestIntegrationFolderPath resolves the real Fibu EDL folder chain
|
|
// (project root 522 → Eingangsrechnungen 647 → 2025 649) to titles.
|
|
func TestIntegrationFolderPath(t *testing.T) {
|
|
creds := GetEnvironmentCredentials()
|
|
if strings.TrimSpace(creds.Url) == "" || strings.TrimSpace(creds.User) == "" {
|
|
t.Skip("no ONLYOFFICE_URL/USER credentials")
|
|
}
|
|
c := NewClient(creds)
|
|
ctx := context.Background()
|
|
|
|
path := c.FolderPath(ctx, []string{"522", "647", "649"})
|
|
if len(path) != 3 {
|
|
t.Fatalf("FolderPath returned %v, want 3 segments", path)
|
|
}
|
|
for i, seg := range path {
|
|
if strings.TrimSpace(seg) == "" {
|
|
t.Errorf("segment %d empty: %v", i, path)
|
|
}
|
|
}
|
|
full := c.UniquePath(ctx, []string{"522", "647", "649"}, "Rechnung-x.pdf")
|
|
if !strings.HasSuffix(full, "Rechnung-x.pdf") || !strings.Contains(full, "/") {
|
|
t.Errorf("UniquePath = %q, want a slash-joined path ending in the file", full)
|
|
}
|
|
t.Logf("path=%v full=%q", path, full)
|
|
}
|