From b142d4bc4c9b18711cde3b155f2f63ac2c8b331a Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Wed, 10 Jun 2015 17:55:18 +0300 Subject: [PATCH] component attrUpdate number fix; camera depth test --- HISTORY.md | 7 +++++++ lib/wrappers/Components.js | 1 + package.js | 1 + tests/wrappers/Components/Camera.js | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 tests/wrappers/Components/Camera.js diff --git a/HISTORY.md b/HISTORY.md index 3590c77..033d9f4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,12 @@ ## vNEXT +## v1.2.0 + +* Components [Cc]olor attributes +* Mesh glossiness attribute +* Internal "fvClass" -> "_class"; store classes in FView._classes +* Warn if dev puts more than 1 node inside of famousEach + ## v1.1.0 * Fix for Famous 0.5.2 (and further work on DOMElement handling) diff --git a/lib/wrappers/Components.js b/lib/wrappers/Components.js index 370e9b7..8e18a75 100644 --- a/lib/wrappers/Components.js +++ b/lib/wrappers/Components.js @@ -45,6 +45,7 @@ var ComponentClass = FView._classes._Component = { /* * Action necessary for object values too */ + newValue = value; } diff --git a/package.js b/package.js index 834d5dc..8594251 100644 --- a/package.js +++ b/package.js @@ -75,6 +75,7 @@ Package.onTest(function(api) { 'tests/wrappers/Nodes/Scene.html', 'tests/wrappers/Nodes/Scene.js', 'tests/wrappers/Components.js', + 'tests/wrappers/Components/Camera.js', 'tests/wrappers/Components/Mesh.js', 'tests/wrappers/Components/DOMElement.html', 'tests/wrappers/Components/DOMElement.js', diff --git a/tests/wrappers/Components/Camera.js b/tests/wrappers/Components/Camera.js new file mode 100644 index 0000000..ce7b6c5 --- /dev/null +++ b/tests/wrappers/Components/Camera.js @@ -0,0 +1,19 @@ +/* + * Like Components [cC]olor, but with "; strength" + */ +Tinytest.add('famous-views - Wrappers - Components - Camera - depth', function(test) { + var expectedDepth; + + var cdata = { + instance: { + setDepth: function(depth) { + test.equal(typeof depth, "number"); + test.equal(depth, expectedDepth); + } + } + }; + + expectedDepth = 1000; + FView._classes.Camera.attrUpdate('depth', 1000, null, null, null, cdata); + FView._classes.Camera.attrUpdate('depth', "1000", null, null, null, cdata); +});