From 1644c2eeb43ab7d2a01fe275655c5ec8e06dc0e3 Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Thu, 8 Dec 2016 11:17:38 -0800 Subject: [PATCH] added unit test --- .../developer/tests/unit_tests/entityUnitTests.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/developer/tests/unit_tests/entityUnitTests.js b/scripts/developer/tests/unit_tests/entityUnitTests.js index ad1606c4e9..033a484663 100644 --- a/scripts/developer/tests/unit_tests/entityUnitTests.js +++ b/scripts/developer/tests/unit_tests/entityUnitTests.js @@ -50,4 +50,16 @@ describe('Entity', function() { var props = Entities.getEntityProperties(boxEntity); expect(Math.round(props.position.z)).toEqual(Math.round(newPos.z)); }); + + it("\'s last edited property working correctly", function() { + var props = Entities.getEntityProperties(boxEntity); + expect(props.lastEdited).toBeDefined(); + expect(props.lastEdited).not.toBe(0); + var prevLastEdited = props.lastEdited; + + // Now we make an edit to the entity, which should update its last edited time + Entities.editEntity(boxEntity, {color: {red: 0, green: 255, blue: 0}}); + props = Entities.getEntityProperties(boxEntity); + expect(props.lastEdited).toBeGreaterThan(prevLastEdited); + }); }); \ No newline at end of file