PolymerElements / test-fixture

21 stars 14 forks source link

Comments within the template tags cause issues #9

Closed torcellite closed 8 years ago

torcellite commented 9 years ago

The following code:

HTML

<test-fixture id="active">
    <template>
        <!-- Data binding isn't avaiable yet -->
        <!-- TODO: Mark as issue and wait for it to be resolved -->
        <!-- <navbar-button _label="Active" _active="{{ selected == selected }}"></navbar-button> -->
        <navbar-button _label="Active"></navbar-button>
    </template>
</test-fixture>

JS

assert.equal(navButton.getAttribute('_label'), "Active", "_label is not Active");

Causes:

chrome 43                ✖ views/elements/navbar-button/test/test.html » basic » test fixture active

navButton.getAttribute is not a function

The comments need to be moved out of the template tags for the error to be resolved.

HTML

<!-- Data binding isn't avaiable yet -->
<!-- TODO: Mark as issue and wait for it to be resolved -->
<!-- <navbar-button _label="Active" _active="{{ selected == selected }}"></navbar-button> -->
<test-fixture id="active">
    <template>
        <navbar-button _label="Active"></navbar-button>
    </template>
</test-fixture>
cdata commented 8 years ago

This is a great point. We should probably discard comment nodes.

bicknellr commented 8 years ago

This was fixed by #10; #16 adds a couple tests specifically for this case.

bicknellr commented 8 years ago

16 merged.