michael@0: /* vim: set ts=2 et sw=2 tw=80: */
michael@0: /* Any copyright is dedicated to the Public Domain.
michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0:
michael@0: "use strict";
michael@0:
michael@0: // Test outerHTML edition via the markup-view
michael@0:
michael@0: loadHelperScript("helper_outerhtml_test_runner.js");
michael@0:
michael@0: const TEST_DATA = [
michael@0: {
michael@0: selector: "#badMarkup1",
michael@0: oldHTML: '
badMarkup1
',
michael@0: newHTML: 'badMarkup1
hanging',
michael@0: validate: function(pageNode, selectedNode) {
michael@0: is(pageNode, selectedNode, "Original element is selected");
michael@0:
michael@0: let textNode = pageNode.nextSibling;
michael@0:
michael@0: is(textNode.nodeName, "#text", "Sibling is a text element");
michael@0: is(textNode.data, " hanging", "New text node has expected text content");
michael@0: }
michael@0: },
michael@0: {
michael@0: selector: "#badMarkup2",
michael@0: oldHTML: 'badMarkup2
',
michael@0: newHTML: 'badMarkup2
hanging