feat: promote accepted proposals from API

This commit is contained in:
Josh Creek
2026-09-01 10:29:41 +01:00
parent e0ba6c6ead
commit 03ff8e485e
16 changed files with 270 additions and 49 deletions
+13
View File
@@ -4,6 +4,8 @@ import (
"context"
"testing"
"time"
"github.com/cosmic-clash/cosmic-clash/server/domain"
)
func TestAssignmentProviderFromStorePreservesPlayerScopedRecoveryBoundary(t *testing.T) {
@@ -25,3 +27,14 @@ func TestProposalProviderFromStoreFailsClosedWithoutDatabase(t *testing.T) {
t.Fatal("nil store was treated as an available proposal source")
}
}
func TestProposalPromoterFromStoreFailsClosedWithoutDatabase(t *testing.T) {
promoter := ProposalPromoterFromStore(nil)
if promoter == nil {
t.Fatal("proposal promoter was not created")
}
proposal := domain.Proposal{ProposalID: "proposal-1", State: domain.Accepted}
if err := promoter.Promote(context.Background(), proposal, time.Unix(1000, 0)); err == nil {
t.Fatal("nil store was treated as an available proposal promoter")
}
}