fix: set domain verified if domain policy does not require validation (#4061)

* fix: set domain verified if domain policy does not require validation

* handle domain claimed
This commit is contained in:
Livio Spring
2022-07-28 13:18:31 +02:00
committed by GitHub
parent 0b742233f9
commit 096e12d3d0
14 changed files with 192 additions and 144 deletions

View File

@@ -733,6 +733,39 @@ func TestUserProjection_reduces(t *testing.T) {
},
},
},
{
name: "reduceDomainClaimed",
args: args{
event: getEvent(testEvent(
repository.EventType(user.UserDomainClaimedType),
user.AggregateType,
[]byte(`{
"username": "id@temporary.domain"
}`),
), user.DomainClaimedEventMapper),
},
reduce: (&userProjection{}).reduceDomainClaimed,
want: wantReduce{
aggregateType: user.AggregateType,
sequence: 15,
previousSequence: 10,
projection: UserTable,
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.users2 SET (change_date, username, sequence) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedArgs: []interface{}{
anyArg{},
"id@temporary.domain",
uint64(15),
"agg-id",
"instance-id",
},
},
},
},
},
},
{
name: "reduceHumanProfileChanged",
args: args{