テストフィクスチャにデータを挿入しようとしていますが、これまで達成できませんでした。戻り値このエラー: "was given a model to stamp, but the template is not of a bindable type"
ポリマー2.xユニットテストターゲットプロパティにバインドするためにオプションのコンテンツをフィクスチャに渡します。
私のテストコードは以下のようなものです:
<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>
同様の質問がpolymer 1.0 unit tests - how to bind properties to a child element?ここで尋ねたが、答えはそれが直接ターゲットプロパティを定義しているので、私が何を見ていないました子要素内
Data binding in Polmyer's <test-fixture>でも、それは非常に同じ問題ですが、私にとってもうまくいきませんでした。
私の質問は、Polymer 2.xユニットテストでテストフィクスチャを使って要素にプロパティを渡すにはどうすればいいですか?