- Added configuration options for Stalwart hosted mail in .env.example. - Updated Docker Compose to include Stalwart service with health checks. - Introduced new API endpoints for managing mail domains and migration projects. - Enhanced Authentik blueprints for user enrollment and post-migration security. - Updated OAuth handling for Google and Microsoft migration processes. - Improved error handling and response structures in the mail API. - Added integration tests for email claiming and migration workflows.
33 lines
836 B
Go
33 lines
836 B
Go
package migration
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ultisuite/ulti-backend/internal/mail/hosted"
|
|
)
|
|
|
|
func TestApplyCutoverDNSEmptyObject(t *testing.T) {
|
|
var p Project
|
|
applyCutoverDNS(&p, []byte(`{}`))
|
|
if p.CutoverDNS != nil {
|
|
t.Fatal("expected nil cutover dns for empty object")
|
|
}
|
|
}
|
|
|
|
func TestApplyCutoverDNSReport(t *testing.T) {
|
|
var p Project
|
|
applyCutoverDNS(&p, []byte(`{"domain":"acme.com","txt_verified":true,"mx_verified":false}`))
|
|
if p.CutoverDNS == nil || p.CutoverDNS.Domain != "acme.com" {
|
|
t.Fatalf("got %#v", p.CutoverDNS)
|
|
}
|
|
}
|
|
|
|
func TestDNSReportHasContent(t *testing.T) {
|
|
if dnsReportHasContent(hosted.DNSCheckReport{}) {
|
|
t.Fatal("empty report should have no content")
|
|
}
|
|
if !dnsReportHasContent(hosted.DNSCheckReport{Warnings: []string{"no domain_id"}}) {
|
|
t.Fatal("warnings should count as content")
|
|
}
|
|
}
|