sourced icon indicating copy to clipboard operation
sourced copied to clipboard

Merge of snapshot with Entity null properties fails

Open AlexZeitler opened this issue 8 years ago • 1 comments

We ran into a problem when properties of sourced entities are declared and initialized with null.

function TestNullPropertyEntity () {
  this.property = null;
  Entity.call(this);
}

util.inherits(TestNullPropertyEntity, Entity);

This test fails:

it('should merge a complex snapshot when entity is initialized with null properties', function () {

  var snapshot = {
    property: { subProperty: true },
  };

  var test = new TestNullPropertyEntity();

  test.merge(snapshot);

  test.should.have.property('property');
  test.property.should.have.property('subProperty', true);

});

AlexZeitler avatar Dec 07 '17 09:12 AlexZeitler

@AlexZeitler see my comment on your PR! I closed it due to the entity.js rewrite, so we'll have to see where it can be added back in.

patrickleet avatar Oct 16 '18 16:10 patrickleet