mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Switch test fixed.
This commit is contained in:
@ -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");
|
||||
|
@ -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.");
|
||||
|
Reference in New Issue
Block a user