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