Switch test fixed.

This commit is contained in:
Nedyalko Nikolov
2016-12-28 15:42:32 +02:00
parent 3d820b307b
commit 535a9ba1c2
3 changed files with 4 additions and 4 deletions

View File

@ -78,7 +78,7 @@ allTests["BUTTON"] = require("./ui/button/button-tests");
// allTests["TAB-VIEW-NAVIGATION"] = require("./ui/tab-view/tab-view-navigation-tests");
// allTests["IMAGE"] = require("./ui/image/image-tests");
// allTests["SLIDER"] = require("./ui/slider/slider-tests");
// allTests["SWITCH"] = require("./ui/switch/switch-tests");
allTests["SWITCH"] = require("./ui/switch/switch-tests");
// allTests["PROGRESS"] = require("./ui/progress/progress-tests");
// allTests["PLACEHOLDER"] = require("./ui/placeholder/placeholder-tests");
// allTests["PAGE"] = require("./ui/page/page-tests");

View File

@ -90,7 +90,7 @@ export function test_set_native_checked_triggers_propertyChanged() {
function testAction(views: Array<viewModule.View>) {
var checkedChanged = false;
var allChanges = 0;
mySwitch.on(observable.Observable.propertyChangeEvent, function (data: observable.EventData) {
mySwitch.on("checkedChange", function (data: observable.EventData) {
allChanges++;
var propertyData = <observable.PropertyChangeData>data;
if (propertyData && propertyData.propertyName === "checked" && propertyData.value === true) {
@ -100,7 +100,7 @@ export function test_set_native_checked_triggers_propertyChanged() {
setNativeValue(mySwitch, true);
mySwitch.off(observable.Observable.propertyChangeEvent);
mySwitch.off("checkedChange");
TKUnit.assert(checkedChanged, "Property changed for checked not called.");
TKUnit.assertEqual(allChanges, 1, "Property changed callbacks.");