setStyle implementation + test

This commit is contained in:
Vladimir Enchev
2015-08-28 10:46:35 +03:00
parent db8b1172f9
commit 3fb4b59b87
3 changed files with 26 additions and 0 deletions

View File

@@ -613,6 +613,20 @@ export var testIsVisible = function () {
});
}
export var testSetStyle = function () {
var lbl = new label.Label();
var expectedColor = "#ff0000";
var expectedBackgroundColor = "#ff0000";
lbl.setStyle(`color: ${expectedColor};background-color: ${expectedBackgroundColor};`);
helper.buildUIAndRunTest(lbl, function (views: Array<viewModule.View>) {
TKUnit.assert(lbl.color.hex === expectedColor, "Actual: " + lbl.color.hex + "; Expected: " + expectedColor);
TKUnit.assert(lbl.backgroundColor.hex === expectedBackgroundColor, "Actual: " + lbl.backgroundColor.hex + "; Expected: " + expectedBackgroundColor);
});
}
export var testBorderWidth = function () {
helper.buildUIAndRunTest(_createLabelWithBorder(), function (views: Array<viewModule.View>) {
var lbl = <label.Label>views[0];