@@ -8,17 +8,19 @@ import type {
8
8
PopoverDomRef
9
9
} from '../..' ;
10
10
import {
11
- Popover ,
12
11
AnalyticalTable ,
13
12
AnalyticalTableHooks ,
13
+ AnalyticalTablePopinDisplay ,
14
14
AnalyticalTableScaleWidthMode ,
15
15
AnalyticalTableSelectionBehavior ,
16
16
AnalyticalTableSelectionMode ,
17
17
AnalyticalTableSubComponentsBehavior ,
18
18
AnalyticalTableVisibleRowCountMode ,
19
19
Button ,
20
20
IndicationColor ,
21
- Input
21
+ Input ,
22
+ Popover ,
23
+ Text
22
24
} from '../..' ;
23
25
import { useManualRowSelect } from './pluginHooks/useManualRowSelect' ;
24
26
import { useRowDisableSelection } from './pluginHooks/useRowDisableSelection' ;
@@ -1987,13 +1989,15 @@ describe('AnalyticalTable', () => {
1987
1989
[ 'ltr' , 'rtl' ] . forEach ( ( dir ) => {
1988
1990
cy . mount ( < AnalyticalTable data = { data } columns = { columnsWithPopIn } dir = { dir } /> ) ;
1989
1991
cy . viewport ( 801 , 1024 ) ;
1990
-
1991
1992
cy . findByText ( 'Name' ) . should ( 'be.visible' ) ;
1992
1993
cy . findByText ( 'Age' ) . should ( 'be.visible' ) ;
1993
1994
cy . findByText ( 'Friend Name' ) . should ( 'be.visible' ) ;
1994
1995
cy . findByText ( 'Custom original Header1' ) . should ( 'be.visible' ) ;
1995
1996
cy . findByText ( 'Custom original Header2' ) . should ( 'be.visible' ) ;
1996
1997
cy . findByText ( 'Custom Header' ) . should ( 'be.visible' ) ;
1998
+ cy . findByText ( 'Custom Header' ) . should ( 'be.visible' ) ;
1999
+ cy . findByText ( 'PopinDisplay Modes' ) . should ( 'be.visible' ) . should ( 'have.attr' , 'ui5-text' ) ;
2000
+ cy . findAllByTestId ( 'popinCell' ) . should ( 'exist' ) ;
1997
2001
cy . contains ( 'Custom Cell 2' ) . should ( 'be.visible' ) ;
1998
2002
1999
2003
cy . contains ( 'Custom Header 1' ) . should ( 'not.exist' ) ;
@@ -2018,18 +2022,77 @@ describe('AnalyticalTable', () => {
2018
2022
cy . contains ( 'Custom Header 2' ) . should ( 'be.visible' ) ;
2019
2023
cy . contains ( 'pop-in content' ) . should ( 'exist' ) ;
2020
2024
cy . contains ( 'C' ) . should ( 'exist' ) ;
2025
+ cy . findAllByTestId ( 'popinCell' ) . should ( 'exist' ) ;
2026
+ cy . findAllByText ( 'PopinDisplay Modes:' ) . as ( 'popinHeader' ) . should ( 'be.exist' ) ;
2027
+ //popinDisplay: Block
2028
+ cy . get ( '@popinHeader' ) . parent ( ) . should ( 'have.css' , 'flex-direction' , 'column' ) ;
2021
2029
2022
2030
cy . viewport ( 600 , 1024 ) ;
2023
2031
cy . wait ( 200 ) ;
2024
2032
cy . contains ( 'Age' ) . should ( 'not.exist' ) ;
2025
2033
cy . contains ( '40' ) . should ( 'not.exist' ) ;
2034
+
2035
+ cy . mount (
2036
+ < AnalyticalTable
2037
+ data = { data }
2038
+ columns = { [
2039
+ ...columnsWithPopIn . slice ( 0 , - 1 ) ,
2040
+ {
2041
+ id : 'popinDisplay' ,
2042
+ Header : 'PopinDisplay Modes' ,
2043
+ responsivePopIn : true ,
2044
+ responsiveMinWidth : 801 ,
2045
+ popinDisplay : AnalyticalTablePopinDisplay . Inline ,
2046
+ Cell : ( ) => {
2047
+ return (
2048
+ < Text data-testid = "popinCell" maxLines = { 1 } >
2049
+ Popin Cell
2050
+ </ Text >
2051
+ ) ;
2052
+ }
2053
+ }
2054
+ ] }
2055
+ dir = { dir }
2056
+ />
2057
+ ) ;
2058
+ cy . findAllByText ( 'PopinDisplay Modes:' ) . as ( 'popinHeader' ) . should ( 'be.exist' ) ;
2059
+ //popinDisplay: Row
2060
+ cy . get ( '@popinHeader' ) . parent ( ) . should ( 'have.css' , 'flex-direction' , 'row' ) ;
2061
+ cy . findAllByTestId ( 'popinCell' ) . should ( 'exist' ) ;
2062
+
2063
+ cy . mount (
2064
+ < AnalyticalTable
2065
+ data = { data }
2066
+ columns = { [
2067
+ ...columnsWithPopIn . slice ( 0 , - 1 ) ,
2068
+ {
2069
+ id : 'popinDisplay' ,
2070
+ Header : 'PopinDisplay Modes' ,
2071
+ responsivePopIn : true ,
2072
+ responsiveMinWidth : 801 ,
2073
+ popinDisplay : AnalyticalTablePopinDisplay . WithoutHeader ,
2074
+ Cell : ( ) => {
2075
+ return (
2076
+ < Text data-testid = "popinCell" maxLines = { 1 } >
2077
+ Popin Cell
2078
+ </ Text >
2079
+ ) ;
2080
+ }
2081
+ }
2082
+ ] }
2083
+ dir = { dir }
2084
+ />
2085
+ ) ;
2086
+ //popinDisplay: WithoutHeader
2087
+ cy . findAllByText ( 'PopinDisplay Modes:' ) . should ( 'not.exist' ) ;
2088
+ cy . findAllByTestId ( 'popinCell' ) . should ( 'exist' ) ;
2026
2089
} ) ;
2027
2090
} ) ;
2028
2091
2029
2092
it ( 'pop-in columns: adjustTableHeightOnPopIn ' , ( ) => {
2030
2093
document . body . style . margin = '0px' ;
2031
2094
cy . viewport ( 800 , 2000 ) ;
2032
- cy . mount ( < AnalyticalTable data = { data } columns = { columnsWithPopIn } adjustTableHeightOnPopIn /> ) ;
2095
+ cy . mount ( < AnalyticalTable data = { data } columns = { columnsWithPopIn } adjustTableHeightOnPopIn data-testid = "table" /> ) ;
2033
2096
2034
2097
cy . findByText ( 'Name' ) . should ( 'be.visible' ) ;
2035
2098
cy . findByText ( 'Age' ) . should ( 'be.visible' ) ;
@@ -2041,12 +2104,68 @@ describe('AnalyticalTable', () => {
2041
2104
cy . findByText ( 'Custom original Header2' ) . should ( 'not.exist' ) ;
2042
2105
cy . contains ( 'Custom Header' ) . should ( 'be.visible' ) ;
2043
2106
cy . contains ( 'Custom Cell 2' ) . should ( 'be.visible' ) ;
2107
+ cy . findAllByTestId ( 'popinCell' ) . should ( 'be.visible' ) ;
2044
2108
2045
2109
cy . contains ( 'Custom Header 1' ) . should ( 'be.visible' ) ;
2046
2110
cy . contains ( 'Custom Header 2' ) . should ( 'be.visible' ) ;
2047
2111
cy . contains ( 'pop-in content' ) . should ( 'be.visible' ) ;
2048
2112
2049
2113
cy . contains ( 'C' ) . should ( 'be.visible' ) ;
2114
+ cy . findByTestId ( 'table' ) . should ( 'have.css' , 'height' , '1764px' ) ;
2115
+
2116
+ cy . mount (
2117
+ < AnalyticalTable
2118
+ data = { data }
2119
+ columns = { [
2120
+ ...columnsWithPopIn . slice ( 0 , - 1 ) ,
2121
+ {
2122
+ id : 'popinDisplay' ,
2123
+ Header : 'PopinDisplay Modes' ,
2124
+ responsivePopIn : true ,
2125
+ responsiveMinWidth : 801 ,
2126
+ popinDisplay : AnalyticalTablePopinDisplay . Inline ,
2127
+ Cell : ( ) => {
2128
+ return (
2129
+ < Text data-testid = "popinCell" maxLines = { 1 } >
2130
+ Popin Cell
2131
+ </ Text >
2132
+ ) ;
2133
+ }
2134
+ }
2135
+ ] }
2136
+ data-testid = "table"
2137
+ adjustTableHeightOnPopIn
2138
+ />
2139
+ ) ;
2140
+ cy . findAllByTestId ( 'popinCell' ) . should ( 'be.visible' ) ;
2141
+ cy . findByTestId ( 'table' ) . should ( 'have.css' , 'height' , '1684px' ) ;
2142
+
2143
+ cy . mount (
2144
+ < AnalyticalTable
2145
+ data = { data }
2146
+ columns = { [
2147
+ ...columnsWithPopIn . slice ( 0 , - 1 ) ,
2148
+ {
2149
+ id : 'popinDisplay' ,
2150
+ Header : 'PopinDisplay Modes' ,
2151
+ responsivePopIn : true ,
2152
+ responsiveMinWidth : 801 ,
2153
+ popinDisplay : AnalyticalTablePopinDisplay . WithoutHeader ,
2154
+ Cell : ( ) => {
2155
+ return (
2156
+ < Text data-testid = "popinCell" maxLines = { 1 } >
2157
+ Popin Cell
2158
+ </ Text >
2159
+ ) ;
2160
+ }
2161
+ }
2162
+ ] }
2163
+ data-testid = "table"
2164
+ adjustTableHeightOnPopIn
2165
+ />
2166
+ ) ;
2167
+ cy . findAllByTestId ( 'popinCell' ) . should ( 'be.visible' ) ;
2168
+ cy . findByTestId ( 'table' ) . should ( 'have.css' , 'height' , '1684px' ) ;
2050
2169
} ) ;
2051
2170
2052
2171
it ( 'plugin hook: useRowDisableSelection' , ( ) => {
@@ -3428,6 +3547,20 @@ const columnsWithPopIn = [
3428
3547
}
3429
3548
return 'original content' ;
3430
3549
}
3550
+ } ,
3551
+ {
3552
+ id : 'popinDisplay' ,
3553
+ Header : 'PopinDisplay Modes' ,
3554
+ responsivePopIn : true ,
3555
+ responsiveMinWidth : 801 ,
3556
+ popinDisplay : 'Block' ,
3557
+ Cell : ( ) => {
3558
+ return (
3559
+ < Text data-testid = "popinCell" maxLines = { 1 } >
3560
+ Popin Cell
3561
+ </ Text >
3562
+ ) ;
3563
+ }
3431
3564
}
3432
3565
] ;
3433
3566
0 commit comments