forked from sugarlabs/sugar-web
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to add a test for icon.js - but not working
- Loading branch information
Manuel Quiñones
committed
Jun 10, 2013
1 parent
5cad6bc
commit 5e0f86b
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters