From 7eb89613ccee118d97a48d83336bbea44614da18 Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 23 Jun 2016 16:09:25 -0700 Subject: icon-factory - overhaul to provide svg or imagified el --- test/unit/lib/icon-factory-test.js | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 test/unit/lib/icon-factory-test.js (limited to 'test') diff --git a/test/unit/lib/icon-factory-test.js b/test/unit/lib/icon-factory-test.js deleted file mode 100644 index 2f24d408c..000000000 --- a/test/unit/lib/icon-factory-test.js +++ /dev/null @@ -1,31 +0,0 @@ -const assert = require('assert') -const sinon = require('sinon') - -const path = require('path') -const IconFactoryGen = require(path.join(__dirname, '..', '..', '..', 'ui', 'lib', 'icon-factory.js')) - -describe('icon-factory', function() { - let iconFactory, address, diameter - - beforeEach(function() { - iconFactory = IconFactoryGen((d,n) => 'stubicon') - address = '0x012345671234567890' - diameter = 50 - }) - - it('should return a data-uri string for any address and diameter', function() { - const output = iconFactory.iconForAddress(address, diameter) - assert.ok(output.indexOf('data:image/svg') === 0) - assert.equal(output, iconFactory.cache[address][diameter]) - }) - - it('should default to cache first', function() { - const testOutput = 'foo' - const mockSizeCache = {} - mockSizeCache[diameter] = testOutput - iconFactory.cache[address] = mockSizeCache - - const output = iconFactory.iconForAddress(address, diameter) - assert.equal(output, testOutput) - }) -}) -- cgit v1.2.3