Files
Docwell/Server/internal/directory/verify_test.go
T
tajniak81andClaude Opus 5.5 c98b127f1e
CI / go (Media) (push) Successful in 13m40s
CI / go (Server) (push) Failing after 23m20s
CI / go (Web-App) (push) Canceled after 0s
CI / frontend (push) Failing after 10m35s
Docs / build (push) Canceled after 0s
Docs / deploy (push) Canceled after 0s
CI / desktop (ubuntu-latest) (push) Failing after 3h4m42s
CI / desktop (macos-latest) (push) Canceled after 0s
CI / desktop (windows-latest) (push) Canceled after 0s
CI / mobile (push) Failing after 9m19s
CI / docker (push) Successful in 2h2m57s
Add columns, suggesting mode, verified pages, scanned PDF search and server translations
- Columns: /columns puts 2 to 4 columns side by side, with widths dragged
  between them; they stack on phones. HTML export and import keep them
  (also Notion column lists and Confluence page layouts).
- Suggesting mode: edits become suggested insertions and deletions that
  editors accept or reject one by one or all at once. Text only.
- Verified pages: editors verify a page for a while or without end; the
  verifier is notified when it runs out (migration 1764700000).
- Scanned PDFs attached to pages are read by AI for search where a
  workspace turns it on.
- The server writes error messages, emails, digests and phone
  notifications in English, Polish, German, French and Spanish; the apps
  send their language with each request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:38:08 +01:00

37 lines
828 B
Go

// SPDX-License-Identifier: AGPL-3.0-or-later
package directory
import (
"testing"
"time"
)
func TestVerificationRunsOutAtItsEnd(t *testing.T) {
now := time.Date(2026, 11, 16, 12, 0, 0, 0, time.UTC)
cases := []struct {
until string
want bool
}{
{"", false}, // no end
{pbTime(now.Add(time.Hour)), false},
{pbTime(now), true},
{pbTime(now.Add(-24 * time.Hour)), true},
{"not a time", false},
}
for _, c := range cases {
if got := verificationExpired(c.until, now); got != c.want {
t.Errorf("verificationExpired(%q) = %v, want %v", c.until, got, c.want)
}
}
}
func TestVerifyExpiredOutranksOtherReasons(t *testing.T) {
e := event{to: map[string]string{}}
e.add("u1", NotifyComment)
e.add("u1", NotifyVerifyExpired)
if e.to["u1"] != NotifyVerifyExpired {
t.Errorf("got %q", e.to["u1"])
}
}