mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Undefined can be set as localValue to dependency observable (#2268)
* Undefined can be set as localValue to dependency observable * Fix build error in tests
This commit is contained in:
@@ -233,7 +233,7 @@ export function test_PropertyMetadata_Options() {
|
||||
|
||||
export function test_PropertyEntry_effectiveValue() {
|
||||
var p = new dependencyObservableModule.Property(generatePropertyName(), "testOwner", new dependencyObservableModule.PropertyMetadata(0));
|
||||
var entry = new dependencyObservableModule.PropertyEntry(p);
|
||||
var entry = new dependencyObservableModule.PropertyEntry();
|
||||
|
||||
// default value
|
||||
TKUnit.assertEqual(entry.effectiveValue, undefined, "effectiveValue should be undefined.");
|
||||
|
||||
@@ -2,6 +2,7 @@ import color = require("color");
|
||||
import button = require("ui/button");
|
||||
import stack = require("ui/layouts/stack-layout");
|
||||
import helper = require("../helper");
|
||||
import TKUnit = require("../../TKUnit");
|
||||
|
||||
export var test_value_Inherited_stronger_than_Default = function () {
|
||||
let page = helper.getCurrentPage();
|
||||
@@ -26,7 +27,7 @@ export var test_value_Css_stronger_than_Inherited = function () {
|
||||
helper.assertViewColor(btn, "#0000FF");
|
||||
}
|
||||
|
||||
export var test_value_Local_stronger_than_Css = function () {
|
||||
export function test_value_Local_stronger_than_Css() {
|
||||
let testPage = helper.getCurrentPage();
|
||||
let testStack = new stack.StackLayout();
|
||||
testPage.content = testStack;
|
||||
@@ -39,7 +40,7 @@ export var test_value_Local_stronger_than_Css = function () {
|
||||
btn.style.color = new color.Color("#0000FF");
|
||||
helper.assertViewColor(btn, "#0000FF");
|
||||
btn.style.color = undefined;
|
||||
helper.assertViewColor(btn, "#FF0000");
|
||||
TKUnit.assertEqual(btn.style.color, undefined, "style.color should be undefined when set locally.");
|
||||
}
|
||||
|
||||
export var test_value_VisualState_stronger_than_Local = function () {
|
||||
|
||||
Reference in New Issue
Block a user