jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Fixture has <tr> and <td> stripped out when not in <table> #382

Closed drogar closed 9 years ago

drogar commented 9 years ago

I often return HTML partials, such as a table row, in ajax interactions.

Given a fixture named 'whatever.html' that looks like:

<tr>
  <td>Some thing</td>
</tr>

Then, when calling loadFixture('whatever.html') the tr and tds are stripped, leaving only Some thing.

Is it possible to return the verbatim html?

jejacks0n commented 9 years ago

It's removed when inserted into the DOM/converted to elements via jquery. It's not really a fixture thing, it's a valid HTML thing.

I'll think on a way to circumvent that.


Jeremy Jackson 303-507-6846

On Jun 26, 2015, at 2:52 PM, Brett G. Giles notifications@github.com wrote:

I often return HTML partials, such as a table row, in ajax interactions.

Given a fixture named 'whatever.html' that looks like:

Some thing

Then, when calling loadFixture('whatever.html') the tr and tds are stripped, leaving only Some thing.

Is it possible to return the verbatim html?

— Reply to this email directly or view it on GitHub.

mikepack commented 9 years ago

I don't think there's a good way around this other than restructuring the markup you're returning. Even innerHTML suffers from this problem.

drogar commented 9 years ago

OK - Thanks for trying!

mikepack commented 9 years ago

@drogar, if you have jQuery in your project (Teaspoon doesn't ship with it), this should work for you once #389 lands.