mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
Fixed Progress tests.
This commit is contained in:
@ -79,7 +79,7 @@ allTests["TAB-VIEW"] = require("./ui/tab-view/tab-view-tests");
|
||||
// allTests["IMAGE"] = require("./ui/image/image-tests");
|
||||
// allTests["SLIDER"] = require("./ui/slider/slider-tests");
|
||||
allTests["SWITCH"] = require("./ui/switch/switch-tests");
|
||||
// allTests["PROGRESS"] = require("./ui/progress/progress-tests");
|
||||
allTests["PROGRESS"] = require("./ui/progress/progress-tests");
|
||||
// allTests["PLACEHOLDER"] = require("./ui/placeholder/placeholder-tests");
|
||||
// allTests["PAGE"] = require("./ui/page/page-tests");
|
||||
// allTests["LISTVIEW"] = require("./ui/list-view/list-view-tests");
|
||||
|
@ -103,18 +103,24 @@ export function test_property_changed_event_when_setting_maxValue_with_adjust()
|
||||
function testAction(views: Array<viewModule.View>) {
|
||||
var changedProperties = {};
|
||||
var allChanges = 0;
|
||||
progress.on(observable.Observable.propertyChangeEvent, function (data: observable.EventData) {
|
||||
progress.on("valueChange", function (data: observable.EventData) {
|
||||
allChanges++;
|
||||
changedProperties[(<observable.PropertyChangeData>data).propertyName] = true;
|
||||
});
|
||||
|
||||
progress.on("maxValueChange", function (data: observable.EventData) {
|
||||
allChanges++;
|
||||
changedProperties[(<observable.PropertyChangeData>data).propertyName] = true;
|
||||
});
|
||||
|
||||
// Act
|
||||
progress.maxValue = 40;
|
||||
progress.off(observable.Observable.propertyChangeEvent);
|
||||
progress.off("valueChange");
|
||||
progress.off("maxValueChange");
|
||||
|
||||
// Assert
|
||||
TKUnit.assert(changedProperties["value"], "Property changed for 'value' not called.");
|
||||
TKUnit.assert(changedProperties["maxValue"], "Property changed for 'maxValue' not called.");
|
||||
TKUnit.assert(changedProperties["value"], "Property changed for 'value' not called.");
|
||||
TKUnit.assertEqual(allChanges, 2, "Property changed callbacks.");
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user