basic test for computed expression containing literal args (must also contain at least one push dependency at this time)

This commit is contained in:
Scott J Miles
2015-05-18 16:49:29 -07:00
committed by Kevin Schaaf
parent 69c472fe9a
commit 3fd8fbb973
2 changed files with 14 additions and 2 deletions

View File

@@ -13,7 +13,9 @@
style$="{{boundStyle}}"
data-id$="{{dataSetId}}"
custom-event-value="{{customEventValue::custom}}"
custom-event-object-value="{{customEventObject.value::change}}">
custom-event-object-value="{{customEventObject.value::change}}"
computed-from-mixed-literals='{{computeFromLiterals(3, "foo", bool)}}'
>
Test
</div>
<span id="boundText">{{text}}</span>
@@ -82,7 +84,7 @@
}
},
observers: [
'multipleDepChangeHandler(dep1 dep2 dep3)',
'multipleDepChangeHandler(dep1, dep2, dep3)',
'customEventObjectValueChanged(customEventObject.value)'
],
created: function() {
@@ -184,6 +186,11 @@
assert.equal(arguments.length, 1, 'observer argument length wrong');
assert.equal(val, this.customEventObject.value, 'observer value argument wrong');
// note, no `old` argument for path observers
},
computeFromLiterals: function(num, str) {
assert.equal(num, 3);
assert.equal(str, 'foo');
return num + str;
}
});
</script>