diff --git a/packages/fiori/cypress/specs/ShellBarItem.cy.tsx b/packages/fiori/cypress/specs/ShellBarItem.cy.tsx new file mode 100644 index 000000000000..005e1759b1ea --- /dev/null +++ b/packages/fiori/cypress/specs/ShellBarItem.cy.tsx @@ -0,0 +1,62 @@ +import ShellBar from "../../src/ShellBar.js"; +import ShellBarItem from "../../src/ShellBarItem.js"; +import Button from "@ui5/webcomponents/dist/Button.js"; +import Avatar from "@ui5/webcomponents/dist/Avatar.js"; +import Input from "@ui5/webcomponents/dist/Input.js"; + +describe("ShellBarItem getFocusDomRef", () => { + it("should return the correct DOM element when item is in the bar", () => { + cy.mount( + + + + ); + + cy.get("#item1") + .then(($item) => { + const focusRef = $item[0].getFocusDomRef(); + expect(focusRef).to.be.instanceOf(HTMLElement); + expect(focusRef).has.attr('ui5-button'); + expect(focusRef?.getAttribute('data-ui5-stable')).to.equal('item-1'); + }); + }); + + it("should return the correct DOM element when item is in overflow popover", () => { + cy.mount( + +