| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -521,7 +521,18 @@ export function test_CorrectPropertyValueAfterUsingWrappedValue() { | |||
| 521 | 521 | ||
| 522 | 522 | testObservable.set("property1", wrappedArray); | |
| 523 | 523 | ||
| 524 | - TKUnit.assertEqual(testObservable.get("property1"), testArray, "WrappedValue is used only to execute property change logic and unwrapped value should be used as proeprty value."); | ||
| 524 | + TKUnit.assertEqual(testObservable.get("property1"), testArray, "WrappedValue is used only to execute property change logic and unwrapped value should be used as property value."); | ||
| 525 | + } | ||
| 526 | + | ||
| 527 | + export function test_CorrectPropertyValueAfterUsingStringEmptyWrappedValue() { | ||
| 528 | + const emptyString = ""; | ||
| 529 | + let testObservable = fromObject({ "property1": emptyString }); | ||
| 530 | + | ||
| 531 | + let wrappedEmptyString = WrappedValue.wrap(emptyString); | ||
| 532 | + | ||
| 533 | + testObservable.set("property1", wrappedEmptyString); | ||
| 534 | + | ||
| 535 | + TKUnit.assertEqual(testObservable.get("property1"), emptyString, "WrappedValue is used only to execute property change logic and unwrapped value should be used as property value."); | ||
| 525 | 536 | } | |
| 526 | 537 | ||
| 527 | 538 | export function test_NestedObservablesWithObservableArrayShouldNotCrash() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ export class WrappedValue implements WrappedValueDefinition { | |||
| 13 | 13 | } | |
| 14 | 14 | ||
| 15 | 15 | public static unwrap(value: any) { | |
| 16 | - return (value && value.wrapped) ? value.wrapped : value; | ||
| 16 | + return (value instanceof WrappedValue) ? value.wrapped : value; | ||
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | 19 | public static wrap(value: any) { | |
@@ -249,4 +249,4 @@ export function fromObjectRecursive(source: any): Observable { | |||
| 249 | 249 | let observable = new ObservableFromObject(); | |
| 250 | 250 | addPropertiesFromObject(observable, source, true); | |
| 251 | 251 | return observable; | |
| 252 | - } | ||
| 252 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments