From c3092db208a6ec7c47c3d798f6933d3e458a038e Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 21 May 2011 12:47:58 +0200 Subject: [PATCH] Add Raster specific tests to compareItems helper function. --- test/lib/helpers.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/test/lib/helpers.js b/test/lib/helpers.js index 282ac648..09ced436 100644 --- a/test/lib/helpers.js +++ b/test/lib/helpers.js @@ -168,9 +168,23 @@ function compareItems(item, item2) { return item.symbol == item2.symbol; }, true); } - - // TODO: Raster specific - + + // Raster specific + if (item instanceof Raster) { + if (item._canvas) { + equals(function() { + return item._canvas != item2._canvas; + }, true); + } + if (item._image) { + equals(function() { + return item._image = item2._image; + }, true); + } + equals(item._size.toString(), item2._size.toString(), + 'item._size.toString() == item2._size.toString()'); + } + // TextItem specific: if (item instanceof TextItem) { equals(item.content, item2.content, 'item.content == item2.content');