/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from helper_outerhtml_test_runner.js */
"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* ({pageNodeFront, selectedNodeFront, testActor}) {
is(pageNodeFront, selectedNodeFront, "Original element is selected");
let textNodeName = yield testActor.eval(`
content.document.querySelector("#badMarkup1").nextSibling.nodeName
`);
let textNodeData = yield testActor.eval(`
content.document.querySelector("#badMarkup1").nextSibling.data
`);
is(textNodeName, "#text", "Sibling is a text element");
is(textNodeData, " hanging", "New text node has expected text content");
}
},
{
selector: "#badMarkup2",
oldHTML: "badMarkup2
",
newHTML: "badMarkup2
hanging" +
"