ultisuite-backend/internal/api/office/keys_test.go
R3D347HR4Y 556d5f416d Enhance API and configuration for contact discovery and public sharing
- Introduced new endpoints for contact discovery, including scanning, listing, and managing discovered contacts.
- Implemented retry logic for handling missing DAV credentials during contact operations.
- Added public share functionality for drive API, allowing users to manage public shares, including upload, delete, and rename operations.
- Updated Nextcloud configuration to support public share links and improved error handling for public share permissions.
- Enhanced logging and validation across contact and drive APIs for better error tracking and user feedback.
- Added tests for new contact matching and ranking functionalities to ensure accuracy and reliability.
2026-06-06 20:27:02 +02:00

31 lines
711 B
Go

package office
import "testing"
func TestDocumentKeyStoreStableWhileActive(t *testing.T) {
store := newDocumentKeyStore()
k1 := store.current(99)
k2 := store.current(99)
if k1 != k2 {
t.Fatalf("expected stable key during session, got %q vs %q", k1, k2)
}
}
func TestDocumentKeyStoreRotatesAfterSave(t *testing.T) {
store := newDocumentKeyStore()
before := store.current(7)
store.rotateAfterSave(7)
after := store.current(7)
if before == after {
t.Fatalf("expected new key after save rotation")
}
}
func TestDocumentSessionKeyDiffersByFile(t *testing.T) {
a := documentSessionKey(1, 1)
b := documentSessionKey(2, 1)
if a == b {
t.Fatal("expected different keys for different files")
}
}