Skip to content

Commit

Permalink
feature:WEOS-1131
Browse files Browse the repository at this point in the history
- Added a check on the last event for the delete
  • Loading branch information
RandyDeo committed Feb 7, 2022
1 parent da45dd5 commit 2fc010d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions model/content_entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,16 @@ func TestContentEntity_Delete(t *testing.T) {
if deletedEntity.GetString("Description") != "New Description" {
t.Errorf("expected the updated description to be '%s', got '%s'", "New Description", deletedEntity.GetString("Description"))
}

delEvents := deletedEntity.AggregateRoot.GetNewChanges()
lastEvent := delEvents[len(delEvents)-1].(*model.Event)

if lastEvent == nil {
t.Errorf("expected there to be events on the entity")
}

if lastEvent.Type != "delete" {
t.Errorf("expected the last event to be '%s', got '%s'", "delete", lastEvent.Type)
}

}

0 comments on commit 2fc010d

Please sign in to comment.