Commits

Jop de Klein committed 55e5dd6

Fixed whitespace inconsistency in node tests

Comments (0)

Files changed (2)

         
         var _getRulesRepresentation = function () {
             var rulesRepresentation = 'in:' + settings.styleIncludes.join('') + 
-                                      'out' + settings.styleExcludes.join('');
+                                      'ex' + settings.styleExcludes.join('');
             
             return rulesRepresentation;
         };
         };
         
         that = _getNodeRepresentation();
-        
         return that;
     };
     

tests/unit/test.snap.node.js

 module('Snap.Node');
 
 test('node representation structure', function () {
-   var root = document.getElementById('test_root');
-   
-   var newElement = document.createElement('div');
-   newElement.appendChild(document.createTextNode('foo'));
-   root.appendChild(newElement);
-   
-   var node = snap.node(newElement);
-   
-   ok(node.computedStyle);
-   equals(node.text, 'foo');
+    var root = document.getElementById('test_root');
+
+    var newElement = document.createElement('div');
+    newElement.appendChild(document.createTextNode('foo'));
+    root.appendChild(newElement);
+
+    var node = snap.node(newElement);
+
+    ok(node.computedStyle);
+    equals(node.text, 'foo');
 });
 
 test('styles include setting (internal)', function () {
-   var root = document.getElementById('test_root');
-   var representation = snap.node(root, {'styleIncludes': ['width', 'color']});
-   
-   equals(typeof representation.computedStyle['width'], 'string'); 
-   equals(typeof representation.computedStyle['color'], 'string');
-   equals(typeof representation.computedStyle['font-size'], 'undefined');
+    var root = document.getElementById('test_root');
+    var representation = snap.node(root, {'styleIncludes': ['width', 'color']});
+
+    equals(typeof representation.computedStyle['width'], 'string'); 
+    equals(typeof representation.computedStyle['color'], 'string');
+    equals(typeof representation.computedStyle['font-size'], 'undefined');
 });
 
 test('styles include setting (internal regexp)', function () {
-   var root = document.getElementById('test_root');
-   var node = snap.node(root, {'styleIncludes': [/color/]});
-   
-   var representation = node;
-   
-   equals(typeof representation.computedStyle['background-color'], 'string');
-   equals(typeof representation.computedStyle['color'], 'string');
-   equals(typeof representation.computedStyle['height'], 'undefined');
+    var root = document.getElementById('test_root');
+    var node = snap.node(root, {'styleIncludes': [/color/]});
+
+    var representation = node;
+
+    equals(typeof representation.computedStyle['background-color'], 'string');
+    equals(typeof representation.computedStyle['color'], 'string');
+    equals(typeof representation.computedStyle['height'], 'undefined');
 });
 
 test('styles exclude setting (internal defaults)', function () {
-   var root = document.getElementById('test_root');
-   var representation = snap.node(root);
-   
-   equals(representation.computedStyle['1'], undefined); // no numbers
-   equals(representation.computedStyle['-moz-appearance'], undefined); // no mozilla specifics
-   equals(representation.computedStyle['-webkit-appearance'], undefined); // no webkit specifics
-   
-   var computedStyle = _getComputedStyle(root);
+    var root = document.getElementById('test_root');
+    var representation = snap.node(root);
 
-   equals(representation.computedStyle['font-size'], computedStyle['fontSize']);
+    equals(representation.computedStyle['1'], undefined); // no numbers
+    equals(representation.computedStyle['-moz-appearance'], undefined); // no mozilla specifics
+    equals(representation.computedStyle['-webkit-appearance'], undefined); // no webkit specifics
+
+    var computedStyle = _getComputedStyle(root);
+
+    equals(representation.computedStyle['font-size'], computedStyle['fontSize']);
 });
 
 test('styles exclude setting (global)', function () {