@@ -266,40 +266,40 @@ describe("Accessibility", () => {
266266 < div slot = "header" />
267267 </ Popover >
268268 ) ;
269-
269+
270270 cy . get ( "[ui5-popover]" ) . invoke ( "removeAttr" , "accessible-name" ) ;
271-
271+
272272 cy . get ( "[ui5-popover]" )
273273 . shadow ( )
274274 . find ( ".ui5-popup-root" )
275275 . should ( "have.attr" , "aria-labelledby" ) ;
276-
276+
277277 cy . get ( "[ui5-popover]" )
278278 . shadow ( )
279279 . find ( ".ui5-popup-root" )
280280 . should ( "not.have.attr" , "aria-label" ) ;
281281 } ) ;
282-
282+
283283 it ( "should use aria-label when accessible-name attribute is set dynamically" , ( ) => {
284284 cy . mount (
285285 < Popover accessibleName = "This popover is important" >
286286 < div slot = "header" />
287287 </ Popover >
288288 ) ;
289-
289+
290290 cy . get ( "[ui5-popover]" ) . invoke ( "attr" , "accessible-name" , "text" ) ;
291-
291+
292292 cy . get ( "[ui5-popover]" )
293293 . shadow ( )
294294 . find ( ".ui5-popup-root" )
295295 . should ( "not.have.attr" , "aria-labelledby" ) ;
296-
296+
297297 cy . get ( "[ui5-popover]" )
298298 . shadow ( )
299299 . find ( ".ui5-popup-root" )
300300 . should ( "have.attr" , "aria-label" ) ;
301301 } ) ;
302-
302+
303303
304304 it ( "tests accessible-name-ref" , ( ) => {
305305 cy . mount (
@@ -652,25 +652,25 @@ describe("Popover opener", () => {
652652 </ Popover >
653653 </ >
654654 ) ;
655-
655+
656656 cy . get ( "#first-focusable" ) . should ( "be.focused" ) ;
657-
657+
658658 cy . realPress ( "Tab" ) ;
659659 cy . wait ( 500 ) ;
660660 cy . get ( "#li1" ) . should ( "be.focused" ) ;
661661 cy . get ( "#first-focusable" ) . should ( "not.be.focused" ) ;
662-
662+
663663 cy . realPress ( "Tab" ) ;
664-
664+
665665 cy . get ( "#first-focusable" ) . should ( "be.focused" ) ;
666-
666+
667667 cy . realPress ( "Tab" ) ;
668668 cy . realPress ( "Tab" ) ;
669-
669+
670670 cy . get ( "#first-focusable" ) . should ( "be.focused" ) ;
671-
671+
672672 cy . realPress ( "Escape" ) ;
673-
673+
674674 cy . get ( "[ui5-popover]" ) . should ( "not.be.visible" ) ;
675675 } ) ;
676676
@@ -967,7 +967,7 @@ describe("Popover opener", () => {
967967
968968 pop . addEventListener ( "ui5-before-open" , async ( ) => {
969969 const applyFocusResult = pop . applyFocus ( ) ;
970- pop . remove ( ) ;
970+ pop . remove ( ) ;
971971
972972 try {
973973 await applyFocusResult ;
@@ -1020,31 +1020,31 @@ describe("Popover opener", () => {
10201020 const container = document . createElement ( "div" ) ;
10211021 container . id = "container" ;
10221022 root [ 0 ] . appendChild ( container ) ;
1023-
1023+
10241024 const shadowRoot = container . attachShadow ( { mode : "open" } ) ;
1025-
1025+
10261026 const opener = document . createElement ( "ui5-button" ) ;
10271027 opener . setAttribute ( "id" , "lnk" ) ;
10281028 opener . textContent = "Open Popover" ;
10291029 shadowRoot . appendChild ( opener ) ;
1030-
1030+
10311031 const popover = document . createElement ( "ui5-popover" ) ;
10321032 popover . setAttribute ( "id" , "pop" ) ;
10331033 popover . setAttribute ( "header-text" , "Popover in Shadow Root" ) ;
10341034 popover . setAttribute ( "opener" , "lnk" ) ;
1035-
1035+
10361036 const content = document . createElement ( "div" ) ;
10371037 content . textContent = "Popover content" ;
10381038 popover . appendChild ( content ) ;
1039-
1039+
10401040 shadowRoot . appendChild ( popover ) ;
10411041 } ) ;
1042-
1042+
10431043 cy . get ( "#container" )
10441044 . shadow ( )
10451045 . find ( "#lnk" )
10461046 . realClick ( ) ;
1047-
1047+
10481048 cy . get ( "#container" )
10491049 . shadow ( )
10501050 . find ( "#pop" )
@@ -1053,7 +1053,7 @@ describe("Popover opener", () => {
10531053 cy . get ( "#container" ) . then ( container => {
10541054 container . remove ( ) ;
10551055 } ) ;
1056- } ) ;
1056+ } ) ;
10571057
10581058 it ( "tests opener set as ID in window.document, while popover is in a shadow root" , ( ) => {
10591059 cy . mount (
@@ -1421,6 +1421,82 @@ describe("Placement", () => {
14211421 expect ( top ) . to . be . lt ( 100 )
14221422 } ) ;
14231423 } ) ;
1424+
1425+ it ( "placement=Start in RTL" , ( ) => {
1426+ cy . mount (
1427+ < div dir = "rtl" >
1428+ < Button id = "btnStart" style = "position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);" > Open</ Button >
1429+ < Popover id = "popoverStart"
1430+ headerText = "Start Placement"
1431+ opener = "btnStart"
1432+ placement = "Start" >
1433+ < div style = "width: 150px; padding: 10px;" >
1434+ Popover with Start placement in RTL mode
1435+ </ div >
1436+ </ Popover >
1437+ </ div >
1438+ ) ;
1439+
1440+ cy . get ( "[ui5-popover]" ) . invoke ( "prop" , "open" , true ) ;
1441+
1442+ cy . get < Popover > ( "[ui5-popover]" ) . should ( "be.visible" ) ;
1443+
1444+ // wait for the popover to be positioned
1445+ // eslint-disable-next-line cypress/no-unnecessary-waiting
1446+ cy . wait ( 200 ) ;
1447+
1448+ let popover ;
1449+ cy . get ( '[ui5-popover]' )
1450+ . then ( $popover => {
1451+ popover = $popover ;
1452+ } ) ;
1453+
1454+ cy . get ( '#btnStart' ) . should ( $opener => {
1455+ const popoverRect = popover [ 0 ] . getBoundingClientRect ( ) ;
1456+ const openerRect = $opener [ 0 ] . getBoundingClientRect ( ) ;
1457+
1458+ // In RTL mode, Start placement should position popover to the right of the opener
1459+ expect ( popoverRect . left ) . to . be . greaterThan ( openerRect . right - 5 ) ;
1460+ } ) ;
1461+ } ) ;
1462+
1463+ it ( "placement=End in RTL" , ( ) => {
1464+ cy . mount (
1465+ < div dir = "rtl" >
1466+ < Button id = "btnEnd" style = "position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);" > Open</ Button >
1467+ < Popover id = "popoverEndg"
1468+ headerText = "End Placement"
1469+ opener = "btnEnd"
1470+ placement = "End" >
1471+ < div style = "width: 150px; padding: 10px;" >
1472+ Popover with End placement in RTL mode
1473+ </ div >
1474+ </ Popover >
1475+ </ div >
1476+ ) ;
1477+
1478+ cy . get ( "[ui5-popover]" ) . invoke ( "prop" , "open" , true ) ;
1479+
1480+ cy . get < Popover > ( "[ui5-popover]" ) . should ( "be.visible" ) ;
1481+
1482+ // wait for the popover to be positioned
1483+ // eslint-disable-next-line cypress/no-unnecessary-waiting
1484+ cy . wait ( 200 ) ;
1485+
1486+ let popover ;
1487+ cy . get ( '[ui5-popover]' )
1488+ . then ( $popover => {
1489+ popover = $popover ;
1490+ } ) ;
1491+
1492+ cy . get ( '#btnEnd' ) . should ( $opener => {
1493+ const popoverRect = popover [ 0 ] . getBoundingClientRect ( ) ;
1494+ const openerRect = $opener [ 0 ] . getBoundingClientRect ( ) ;
1495+
1496+ // In RTL mode, End placement should position popover to the left of the opener
1497+ expect ( popoverRect . right ) . to . be . lessThan ( openerRect . left + 5 ) ;
1498+ } ) ;
1499+ } ) ;
14241500} ) ;
14251501
14261502describe ( "Alignment" , ( ) => {
0 commit comments