Skip to content

Commit d3c6669

Browse files
committed
test(OpenUI5AndWebC): expect isOpen() of sap.m.Dialog to be true
1 parent dda76bd commit d3c6669

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

packages/main/cypress/specs/OpenUI5andWebCPopups.cy.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ import ComboBox from "../../src/ComboBox.js";
77
import ComboBoxItem from "../../src/ComboBoxItem.js";
88
import ResponsivePopover from "../../src/ResponsivePopover.js";
99

10+
let OpenUI5Element;
11+
1012
function onOpenUI5InitMethod(win) {
11-
(win as any).sap.ui.require(["sap/ui/core/HTML", "sap/m/Button", "sap/m/Dialog", "sap/m/Popover", "sap/m/Input"], async (HTML, Button, Dialog, Popover, Input) => {
13+
(win as any).sap.ui.require([
14+
"sap/ui/core/Element",
15+
"sap/ui/core/HTML",
16+
"sap/m/Button",
17+
"sap/m/Dialog",
18+
"sap/m/Popover",
19+
"sap/m/Input"
20+
], async (Element, HTML, Button, Dialog, Popover, Input) => {
1221

1322
await OpenUI5Support.init();
14-
23+
OpenUI5Element = Element;
1524
new Button("openUI5Button", {
1625
text: "Open OpenUI5 Dialog",
1726
press: function () {
@@ -687,7 +696,15 @@ describe("ui5 and web components integration", () => {
687696
.realClick();
688697

689698
cy.get("#openUI5DialogFinal")
690-
.should('be.visible');
699+
.should('be.visible')
700+
.should(($dialog) => {
701+
expect(OpenUI5Element).to.exist;
702+
703+
const dialogInstance = OpenUI5Element.getElementById($dialog.attr("id"));
704+
705+
expect(dialogInstance).to.exist
706+
expect(dialogInstance.isOpen()).to.be.true;
707+
});
691708

692709
cy.get("#openUI5Dialog1")
693710
.should('not.be.visible');

0 commit comments

Comments
 (0)