Skip to content

Commit 42a96f2

Browse files
committed
feat: shouldn't show select parent when elements parent is body tag test
1 parent d7ff9fe commit 42a96f2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/spec/LiveDevelopmentMultiBrowser-test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,6 +2669,37 @@ define(function (require, exports, module) {
26692669

26702670
await endEditModePreviewSession();
26712671
}, 30000);
2672+
2673+
it("should not show select parent option when element's direct parent is body", async function () {
2674+
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["simple1.html"]),
2675+
"SpecRunnerUtils.openProjectFiles simple1.html");
2676+
2677+
await waitsForLiveDevelopmentToOpenWithEditMode('hover');
2678+
2679+
// Click on the test element (which has body as direct parent in simple1.html)
2680+
await forRemoteExec(`document.getElementById('testId').click()`);
2681+
2682+
// Wait for more options box to appear
2683+
await waitForMoreOptionsBox(true);
2684+
2685+
// Check that select-parent option is NOT present in the shadow DOM
2686+
await forRemoteExec(`
2687+
const shadowHosts = Array.from(document.body.children).filter(el => el.shadowRoot);
2688+
let selectParentButton = null;
2689+
2690+
shadowHosts.forEach(host => {
2691+
if (host.shadowRoot && host.shadowRoot.innerHTML.includes('phoenix-more-options-box')) {
2692+
selectParentButton = host.shadowRoot.querySelector('span[data-action="select-parent"]');
2693+
}
2694+
});
2695+
2696+
selectParentButton === null;
2697+
`, (result) => {
2698+
return result === true;
2699+
});
2700+
2701+
await endEditModePreviewSession();
2702+
}, 30000);
26722703
});
26732704
});
26742705
});

0 commit comments

Comments
 (0)