diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/inspector/markup/test/browser_markup_subgrid_display_badge.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_subgrid_display_badge.js | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_subgrid_display_badge.js b/devtools/client/inspector/markup/test/browser_markup_subgrid_display_badge.js new file mode 100644 index 0000000000..0118e5ae33 --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_subgrid_display_badge.js @@ -0,0 +1,78 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URL = URL_ROOT + "doc_markup_subgrid.html"; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + const { highlighters, store } = inspector; + + info("Check the subgrid display badge is shown and not active."); + await selectNode("main", inspector); + const eltContainer = await getContainerForSelector("main", inspector); + const subgridDisplayBadge = eltContainer.elt.querySelector( + ".inspector-badge.interactive[data-display]" + ); + ok( + !subgridDisplayBadge.classList.contains("active"), + "subgrid display badge is not active." + ); + ok( + subgridDisplayBadge.classList.contains("interactive"), + "subgrid display badge is interactive." + ); + + info("Check the initial state of the grid highlighter."); + ok( + !highlighters.gridHighlighters.size, + "No CSS grid highlighter exists in the highlighters overlay." + ); + + info("Toggling ON the CSS grid highlighter from the subgrid display badge."); + const onHighlighterShown = highlighters.once("grid-highlighter-shown"); + let onCheckboxChange = waitUntilState( + store, + state => state.grids.length === 2 && state.grids[1].highlighted + ); + subgridDisplayBadge.click(); + await onHighlighterShown; + await onCheckboxChange; + + info( + "Check that the CSS grid highlighter is created and the display badge state." + ); + is( + highlighters.gridHighlighters.size, + 1, + "CSS grid highlighter is created in the highlighters overlay." + ); + ok( + subgridDisplayBadge.classList.contains("active"), + "subgrid display badge is active." + ); + ok( + subgridDisplayBadge.classList.contains("interactive"), + "subgrid display badge is interactive." + ); + + info("Toggling OFF the CSS grid highlighter from the subgrid display badge."); + const onHighlighterHidden = highlighters.once("grid-highlighter-hidden"); + onCheckboxChange = waitUntilState( + store, + state => state.grids.length == 2 && !state.grids[1].highlighted + ); + subgridDisplayBadge.click(); + await onHighlighterHidden; + await onCheckboxChange; + + ok( + !subgridDisplayBadge.classList.contains("active"), + "subgrid display badge is not active." + ); + ok( + subgridDisplayBadge.classList.contains("interactive"), + "subgrid display badge is interactive." + ); +}); |