"use strict";

var jsdom = require("../..").jsdom;

// These tests are mostly random regression tests, not systematic parsing tests. They are compiled from the bug tracker.

exports["unclosed <td> (GH-605)"] = function (t) {
  var doc = jsdom("<table><tr><td>first td<td>second td</tr></table>");

  var tds = doc.getElementsByTagName("td");

  t.equal(tds.length, 2);
  t.equal(tds[0].innerHTML, 'first td');
  t.equal(tds[1].innerHTML, 'second td');

  t.done();
};

@@ -461,8 +461,311 @@
 e();%0A%7D;%0A
+%0Aexports%5B%22innerHTML of %3Cscript type='text/html'%3E (GH-575)%22%5D = function (t) %7B%0A  var doc = jsdom(%22%3Cscript type='text/html'%3Escript innerHTML%3C/script%3E%22);%0A%0A  var scripts = doc.getElementsByTagName(%22script%22);%0A%0A  t.equal(scripts.length, 1);%0A  t.equal(scripts%5B0%5D.innerHTML, %22script innerHTML%22);%0A%0A  t.done();%0A%7D;%0A

Add test for innerHTML of <script> tags. Fixes #575.