Skip to content

Commit

Permalink
Merge pull request #11857 from ateshuseyin/add-property-definition-ch…
Browse files Browse the repository at this point in the history
…anged

Add definitionChanged test into EntitySpec
  • Loading branch information
ggetz authored Mar 11, 2024
2 parents 4d42f9c + b994b64 commit e5f3109
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/engine/Specs/DataSources/EntitySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,27 @@ describe("DataSources/Entity", function () {
}
});

it("definitionChanged works for properties added via addProperty", function () {
const entity = new Entity();

const propertyName = "justForTest";
entity.addProperty(propertyName);
const oldValue = new ConstantProperty(1);
entity[propertyName] = oldValue;

const listener = jasmine.createSpy("listener");
entity.definitionChanged.addEventListener(listener);

const newValue = new ConstantProperty(1);
entity[propertyName] = newValue;
expect(listener).toHaveBeenCalledWith(
entity,
propertyName,
newValue,
oldValue
);
});

it("merge ignores reserved property names when called with a plain object.", function () {
const entity = new Entity();

Expand Down

0 comments on commit e5f3109

Please sign in to comment.