Adam Shaw 8 лет назад
Родитель
Сommit
89165267ee
2 измененных файлов с 2 добавлено и 13 удалено
  1. 1 1
      tests/lib/dom-geom.js
  2. 1 12
      tests/lib/geom.js

+ 1 - 1
tests/lib/dom-geom.js

@@ -19,7 +19,7 @@ import {
 
 
 
 
 export function getBoundingRects(els) {
 export function getBoundingRects(els) {
-  return $(el).map(function(i, node) {
+  return $(els).map(function(i, node) {
     return getBoundingRect(node)
     return getBoundingRect(node)
   })
   })
 }
 }

+ 1 - 12
tests/lib/geom.js

@@ -24,17 +24,6 @@ export function joinRects(rect1, rect2) {
   }
   }
 }
 }
 
 
-function buildRectViaDims(left, top, width, height) {
-  return {
-    left: left,
-    top: top,
-    width: width,
-    height: height,
-    right: left + width,
-    bottom: top + height
-  }
-}
-
 function buildRectViaEdges(left, top, right, bottom) {
 function buildRectViaEdges(left, top, right, bottom) {
   return {
   return {
     left: left,
     left: left,
@@ -72,7 +61,7 @@ export function getRectTopLeft(rect) {
 }
 }
 
 
 export function isRect(input) {
 export function isRect(input) {
-  return 'left' in input && 'right' in input && 'top' in input && 'bottom' in input
+  return typeof input === 'object' && 'left' in input && 'right' in input && 'top' in input && 'bottom' in input
 }
 }
 
 
 export function isRectMostlyAbove(subjectRect, otherRect) {
 export function isRectMostlyAbove(subjectRect, otherRect) {