diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js b/devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js new file mode 100644 index 0000000000..7de9f90a5b --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js @@ -0,0 +1,73 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* import-globals-from helper_attributes_test_runner.js */ +"use strict"; + +// Test editing various markup-containers' attribute fields + +loadHelperScript("helper_attributes_test_runner.js"); + +const TEST_URL = URL_ROOT + "doc_markup_edit.html"; +var TEST_DATA = [ + { + desc: "Change an attribute", + node: "#node1", + originalAttributes: { + id: "node1", + class: "node1", + }, + name: "class", + value: 'class="changednode1"', + expectedAttributes: { + id: "node1", + class: "changednode1", + }, + }, + { + desc: + 'Try changing an attribute to a quote (") - this should result ' + + "in it being set to an empty string", + node: "#node22", + originalAttributes: { + id: "node22", + class: "unchanged", + }, + name: "class", + value: 'class="""', + expectedAttributes: { + id: "node22", + class: "", + }, + }, + { + desc: "Remove an attribute", + node: "#node4", + originalAttributes: { + id: "node4", + class: "node4", + }, + name: "class", + value: "", + expectedAttributes: { + id: "node4", + }, + }, + { + desc: "Try add attributes by adding to an existing attribute's entry", + node: "#node24", + originalAttributes: { + id: "node24", + }, + name: "id", + value: 'id="node24" class="""', + expectedAttributes: { + id: "node24", + class: "", + }, + }, +]; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + await runEditAttributesTests(TEST_DATA, inspector); +}); |