I am trying to insert data into the test fixture but couldn't achieve so far. Returns this error:
"was given a model to stamp, but the template is not of a bindable type"
My test code is like below:
<test-fixture id="myFixture">
<template is="dom-template">
<my-element given-input="[[selectedInput]]"></myElement>
</template>
</test-fixture>
<script>
suite('<my-element>', function() {
var myEl;
setup(function() {
myEl = fixture('myFixture', {selectedInput: 'test input'});
});
test('initiates my-element', function() {
// fails as givenInput returns "[[selectedInput]]"
assert.equal(myEl.givenInput, 'test input');
});
});
</script>
Similar question was asked here polymer 1.0 unit tests - how to bind properties to a child element? but the answer is not what I look for since it is directly defining target property in the child element
Also in Data binding in Polmyer's <test-fixture> it is very same issue but didn't work for me either.
My question is about, how can we pass a property down to the element through test fixture in Polymer 2.x unit testing?