Skip to content

Commit 7dd6326

Browse files
committed
chore: add test for Select value state message popover width
1 parent 7ab3bfc commit 7dd6326

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,44 @@ describe("Select - Popover", () => {
461461
.should("be.visible")
462462
.should("have.text", "Custom message");
463463
});
464+
465+
it("Value state message popover can extend beyond select width", () => {
466+
cy.mount(
467+
<Select valueState="Critical">
468+
<Option>Short</Option>
469+
<Option>Long</Option>
470+
<div slot="valueStateMessage">
471+
This is a very long value state message that should extend beyond the narrow select component width and not be constrained by it.
472+
</div>
473+
</Select>
474+
);
475+
476+
// Trigger the value state popover by clicking and then pressing Escape
477+
cy.get("[ui5-select]")
478+
.realClick()
479+
.realPress("Escape");
480+
481+
// Get the select width for comparison
482+
cy.get("[ui5-select]")
483+
.invoke("outerWidth")
484+
.as("selectWidth");
485+
486+
// Find the standalone value state popover
487+
cy.get("[ui5-select]")
488+
.shadow()
489+
.find(".ui5-valuestatemessage-popover")
490+
.should("exist")
491+
.as("valueStatePopover");
492+
493+
// Verify the popover width is greater than the select width
494+
cy.get("@valueStatePopover")
495+
.invoke("outerWidth")
496+
.then((popoverWidth) => {
497+
cy.get("@selectWidth").then((selectWidth) => {
498+
expect(popoverWidth).to.be.greaterThan(Number(selectWidth));
499+
});
500+
});
501+
});
464502
});
465503

466504
describe("Select - Properties", () => {

0 commit comments

Comments
 (0)