migrated knockout asset to bower
[openemr.git] / public / assets / knockout-2-2-1 / spec / defaultBindings / styleBehaviors.js
blob097f3ec28111e2a3cb9fc1ba33a7b955b99d5cf1
1 describe('Binding: CSS style', {
2     before_each: JSSpec.prepareTestNode,
4     'Should give the element the specified CSS style value': function () {
5         var myObservable = new ko.observable("red");
6         testNode.innerHTML = "<div data-bind='style: { backgroundColor: colorValue }'>Hallo</div>";
7         ko.applyBindings({ colorValue: myObservable }, testNode);
9         value_of(testNode.childNodes[0].style.backgroundColor).should_be_one_of(["red", "#ff0000"]); // Opera returns style color values in #rrggbb notation, unlike other browsers
10         myObservable("green");
11         value_of(testNode.childNodes[0].style.backgroundColor).should_be_one_of(["green", "#008000"]);
12         myObservable(undefined);
13         value_of(testNode.childNodes[0].style.backgroundColor).should_be("");
14     }
15 });