@@ -13,6 +13,7 @@ import Title from "../../src/Title.js";
1313import Slider from "../../src/Slider.js" ;
1414import Button from "../../src/Button.js" ;
1515
16+ const TRANSPARENT = "rgba(0, 0, 0, 0)" ;
1617
1718describe ( "Table - Rendering" , ( ) => {
1819 function checkWidth ( id : string , expectedWidth : number ) {
@@ -1115,21 +1116,20 @@ describe("Table - Cell Merging", () => {
11151116 mountMergedTable ( ) ;
11161117
11171118 // Merged cell should have transparent top border
1118- cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1119+ cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
11191120 cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "0" ) ;
1120- cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "have.css" , "pointer-events" , "none" ) ;
11211121
11221122 // Non-merged cell should not have transparent border
1123- cy . get ( "#r2cB" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1123+ cy . get ( "#r2cB" ) . should ( "not.have.css" , "border-top-color" , TRANSPARENT ) ;
11241124 cy . get ( "#r2cB" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "1" ) ;
11251125
11261126 // Selection cell should have transparent border when first cell is merged
11271127 cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.attr" , "data-border-merged" ) ;
1128- cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1128+ cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
11291129
11301130 // Selection cell should NOT have transparent border when first cell is not merged
11311131 cy . get ( "#row1" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "not.have.attr" , "data-border-merged" ) ;
1132- cy . get ( "#row1" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1132+ cy . get ( "#row1" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "not.have.css" , "border-top-color" , TRANSPARENT ) ;
11331133 } ) ;
11341134
11351135 it ( "should disable merged styles when row has popin" , ( ) => {
@@ -1138,29 +1138,28 @@ describe("Table - Cell Merging", () => {
11381138 // At full width, merged styles should be active
11391139 cy . get ( "ui5-table" ) . invoke ( "css" , "width" , "600px" ) ;
11401140 cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "0" ) ;
1141- cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1142- cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1141+ cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
1142+ cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
11431143
11441144 // Shrink table to trigger popin
11451145 cy . get ( "ui5-table" ) . invoke ( "css" , "width" , "250px" ) ;
11461146 cy . wait ( 50 ) ;
11471147
11481148 // Merged cell border should fall back to normal border color (not transparent)
11491149 cy . get ( "#row2" ) . should ( "have.attr" , "_haspopin" ) ;
1150- cy . get ( "#r2cA" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1151- cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1150+ cy . get ( "#r2cA" ) . should ( "not.have.css" , "border-top-color" , TRANSPARENT ) ;
1151+ cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "not.have.css" , "border-top-color" , TRANSPARENT ) ;
11521152
11531153 // Merged cell content should be fully visible (opacity back to 1)
11541154 cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "1" ) ;
1155- cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "have.css" , "pointer-events" , "auto" ) ;
11561155
11571156 // Expand table again, merged styles should re-activate
11581157 cy . get ( "ui5-table" ) . invoke ( "css" , "width" , "600px" ) ;
11591158 cy . wait ( 50 ) ;
11601159
11611160 cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "0" ) ;
1162- cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1163- cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1161+ cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
1162+ cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
11641163 } ) ;
11651164
11661165 it ( "should toggle merged styles at runtime" , ( ) => {
@@ -1172,31 +1171,25 @@ describe("Table - Cell Merging", () => {
11721171 // Remove merged attribute
11731172 cy . get ( "#r3cA" ) . invoke ( "removeAttr" , "merged" ) ;
11741173 cy . get ( "#r3cA" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "1" ) ;
1175- cy . get ( "#r3cA" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1174+ cy . get ( "#r3cA" ) . should ( "not.have.css" , "border-top-color" , TRANSPARENT ) ;
11761175
11771176 // Re-add merged attribute
11781177 cy . get ( "#r3cA" ) . invoke ( "prop" , "merged" , true ) ;
11791178 cy . get ( "#r3cA" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "0" ) ;
1180- cy . get ( "#r3cA" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1179+ cy . get ( "#r3cA" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
11811180 } ) ;
11821181
1183- it ( "should disable merged styles on hover and focus" , ( ) => {
1182+ it ( "should disable merged styles on focus" , ( ) => {
11841183 mountMergedTable ( ) ;
11851184
11861185 // Before hover: merged styles active
11871186 cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "have.css" , "opacity" , "0" ) ;
1188- cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1187+ cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
11891188
1190- // On hover : merged cell content should become visible and border should restore
1191- cy . get ( "#row2" ) . realHover ( ) ;
1189+ // On focus : merged cell content should become visible but border should remain transparent
1190+ cy . get ( "#row2" ) . realClick ( ) ;
11921191 cy . get ( "#r2cA" ) . find ( "ui5-label" ) . should ( "not.have.css" , "opacity" , "0" ) ;
1193- cy . get ( "#r2cA" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1194- cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1195-
1196- // On focus: merged cell content should become visible and border should restore
1197- cy . get ( "#row3" ) . realClick ( ) ;
1198- cy . get ( "#r3cA" ) . find ( "ui5-label" ) . should ( "not.have.css" , "opacity" , "0" ) ;
1199- cy . get ( "#r3cA" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1200- cy . get ( "#row3" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "not.have.css" , "border-top-color" , "rgba(0, 0, 0, 0)" ) ;
1192+ cy . get ( "#r2cA" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
1193+ cy . get ( "#row2" ) . shadow ( ) . find ( "#selection-cell" ) . should ( "have.css" , "border-top-color" , TRANSPARENT ) ;
12011194 } ) ;
12021195} ) ;
0 commit comments