Skip to content

Commit

Permalink
Trying to add a test for icon.js - but not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Quiñones committed Jun 10, 2013
1 parent 5cad6bc commit 5e0f86b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/graphics/iconSpec.js
@@ -0,0 +1,36 @@
define(["sugar-web/graphics/icon"], function (icon) {
describe("icon", function () {
var wasLoaded;
var iconUrlResult;

it("should change icon", function () {
var elem = document.createElement('div');
var iconUrl = "url(/base/graphics/icons/actions/dialog-ok-active.svg)";

function callback(url) {
console.log(url);
iconUrlResult = url;
wasLoaded = true;
}

runs(function () {
wasColorized = false;
iconInfo = {
"uri": iconUrl,
"strokeColor": '#B20008',
"fillColor": '#FF2B34'
};
icon.load(iconInfo, callback);
});

waitsFor(function () {
return wasLoaded;
}, "icon loaded");

runs(function () {
expect(iconUrlResult).not.toBe(iconUrl);
});
});
});

});
3 changes: 3 additions & 0 deletions test/karma.conf.js
Expand Up @@ -22,6 +22,9 @@ files = [
pattern: '**/*js',
exclude: 'test/**/*js',
included: false
}, {
pattern: 'graphics/icons/actions/*svg',
included: false
}
];

Expand Down

0 comments on commit 5e0f86b

Please sign in to comment.