mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
feat: promote accepted proposals from API
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user