File tree 4 files changed +23
-3
lines changed
_components_pages/main/Table
_samples/main/Table/NoDataSlot
4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,26 @@ describe("Table - Rendering", () => {
64
64
cy . wait ( 500 ) ;
65
65
} ) ;
66
66
67
+ it ( "tests if table is rendered with no data slot" , ( ) => {
68
+ cy . mount (
69
+ < Table id = "table" >
70
+ < TableHeaderRow slot = "headerRow" >
71
+ < TableHeaderCell > </ TableHeaderCell >
72
+ </ TableHeaderRow >
73
+ < div slot = "noData" id = "noData" >
74
+ < Label > No data found</ Label >
75
+ </ div >
76
+ </ Table >
77
+ ) ;
78
+
79
+ cy . get ( "#table" ) . shadow ( ) . find ( 'slot[name=noData]' ) . as ( "noDataSlot" ) ;
80
+ cy . get ( "@noDataSlot" ) . should ( "exist" ) ;
81
+ cy . get ( "@noDataSlot" ) . then ( ( $noDataSlot ) => {
82
+ const noDataElement = ( $noDataSlot [ 0 ] as HTMLSlotElement ) . assignedElements ( ) [ 0 ] ;
83
+ cy . wrap ( noDataElement ) . should ( "have.attr" , "id" , "noData" )
84
+ } ) ;
85
+ } ) ;
86
+
67
87
it ( "columns have equal widths width default width" , ( ) => {
68
88
cy . mount (
69
89
< Table style = "width: 400px;" id = "table" >
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default function TableTemplate(this: Table) {
27
27
< TableRow id = "no-data-row" >
28
28
< TableCell id = "no-data-cell" data-excluded-from-navigation horizontal-align = "Center" >
29
29
{ this . noData . length > 0 ?
30
- < slot name = "no-data " > </ slot >
30
+ < slot name = "noData " > </ slot >
31
31
:
32
32
this . _effectiveNoDataText
33
33
}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ Enable a sticky header by utilizing the properties `sticky` and `sticky-top` of
46
46
47
47
### No Data
48
48
49
- You can provide an illustration or a custom text, that is shown when the table has no data using the ` no-data ` slot.
49
+ You can provide an illustration or a custom text, that is shown when the table has no data using the ` noData ` slot.
50
50
51
51
<NoDataSlot />
52
52
Original file line number Diff line number Diff line change 11
11
< body style ="background-color: var(--sapBackgroundColor) ">
12
12
<!-- playground-fold-end -->
13
13
< ui5-table id ="table " overflow-mode ="Popin ">
14
- < ui5-illustrated-message slot ="no-data " name ="NoData "> </ ui5-illustrated-message >
14
+ < ui5-illustrated-message slot ="noData " name ="NoData "> </ ui5-illustrated-message >
15
15
<!-- playground-fold -->
16
16
< ui5-table-header-row slot ="headerRow ">
17
17
< ui5-table-header-cell id ="produtCol " width ="300px "> < span > Product</ span > </ ui5-table-header-cell >
You can’t perform that action at this time.
0 commit comments