(views: Array<view.View>)
| 18 | |
| 19 | export var test_goToVisualState = function () { |
| 20 | var test = function (views: Array<view.View>) { |
| 21 | (<page.Page>views[0]).css = 'button:hovered { color: red; background-color: orange } button:pressed { color: white; background-color: black }'; |
| 22 | |
| 23 | var btn = views[1]; |
| 24 | |
| 25 | assertInState(btn, null, ['hovered', 'pressed']); |
| 26 | |
| 27 | btn._goToVisualState('hovered'); |
| 28 | |
| 29 | assertInState(btn, 'hovered', ['hovered', 'pressed']); |
| 30 | |
| 31 | TKUnit.assert(types.isDefined(btn.style.color) && btn.style.color.name === 'red'); |
| 32 | TKUnit.assert(types.isDefined(btn.style.backgroundColor) && btn.style.backgroundColor.name === 'orange'); |
| 33 | |
| 34 | btn._goToVisualState('pressed'); |
| 35 | |
| 36 | assertInState(btn, 'pressed', ['hovered', 'pressed']); |
| 37 | |
| 38 | TKUnit.assert(types.isDefined(btn.style.color) && btn.style.color.name === 'white'); |
| 39 | TKUnit.assert(types.isDefined(btn.style.backgroundColor) && btn.style.backgroundColor.name === 'black'); |
| 40 | }; |
| 41 | |
| 42 | helper.do_PageTest_WithButton(test); |
| 43 | }; |
no test coverage detected