2

How can I use <template is="dom-bind"> within <test-fixture> with web-components-tester?

I have tried to use it Polymer 0.8 x-template way:

<test-fixture id="dom-bind-fixture">
    <template is="dom-bind">
        <h1>{{greeting}}</h2>
    </template>
</test-fixture>
<script>
    // ...
   var bound = fixture('dom-bind-fixture', {greeting: 'ohai thurr'});
</script>

which naturally fails, as dom-bind does not have stamp method.

Then, I tried just stamping it out of native <template> element:

<test-fixture id="dom-bind-fixture">
    <template>
        <h1>outside dom-bind</h1>
        <template is="dom-bind">
            <h2>inside dom-bind</h2>
        </template>
    </template>
</test-fixture>

But in non-Chrome browsers this one stamps only outside dom-bind.

Is there a way to make it work, or is it just a blocking bug in web-components-tester/test-fixture/dom-bind?

tomalec
  • 890
  • 10
  • 27
  • For reference, @tomalec created a [GitHub issue](https://github.com/Polymer/test-fixture/issues/17) to track this. – tony19 Jun 12 '16 at 04:32

1 Answers1

2

Use dom-template, ie:

<test-fixture id="dom-bind-fixture">
    <template is="dom-template">
        <h1>{{greeting}}</h2>
    </template>
</test-fixture>
<script>
    // ...
   var bound = fixture('dom-bind-fixture', {greeting: 'ohai thurr'});
</script>
abendigo
  • 954
  • 1
  • 8
  • 31