@@ -43,9 +43,14 @@ import {
43
43
Title ,
44
44
Toolbar ,
45
45
ToolbarButton ,
46
+ Table ,
47
+ TableCell ,
48
+ TableHeaderCell ,
49
+ TableHeaderRow ,
50
+ TableRow ,
46
51
} from '../..' ;
47
- import { cypressPassThroughTestsFactory } from '@/cypress/support/utils' ;
48
52
import type { TabDomRef } from '../../webComponents/Tab/index.js' ;
53
+ import { cypressPassThroughTestsFactory } from '@/cypress/support/utils' ;
49
54
50
55
const arbitraryCharsId = `~\`!1@#$%^&*()-_+={}[]:;"'z,<.>/?|♥` ;
51
56
@@ -1651,6 +1656,22 @@ describe('ObjectPage', () => {
1651
1656
< Input data-testid = "sub" />
1652
1657
</ ObjectPageSubSection >
1653
1658
</ ObjectPageSection >
1659
+ < ObjectPageSection id = { '7' } titleText = { 'Table' } aria-label = "Table" >
1660
+ < Table data-testid = "table" >
1661
+ < TableHeaderRow slot = "headerRow" >
1662
+ < TableHeaderCell > Product</ TableHeaderCell >
1663
+ < TableHeaderCell > Supplier</ TableHeaderCell >
1664
+ < TableHeaderCell horizontalAlign = "End" > Price</ TableHeaderCell >
1665
+ </ TableHeaderRow >
1666
+ { new Array ( 20 ) . fill ( 1337 ) . map ( ( _ , i ) => (
1667
+ < TableRow key = { i } >
1668
+ < TableCell > Mac</ TableCell >
1669
+ < TableCell > Apple</ TableCell >
1670
+ < TableCell horizontalAlign = "End" > 10.09</ TableCell >
1671
+ </ TableRow >
1672
+ ) ) }
1673
+ </ Table >
1674
+ </ ObjectPageSection >
1654
1675
</ ObjectPage >
1655
1676
</ > ,
1656
1677
) ;
@@ -1691,9 +1712,18 @@ describe('ObjectPage', () => {
1691
1712
// 6.2 input
1692
1713
cy . realPress ( 'Tab' ) ;
1693
1714
cy . findByTestId ( 'sub' ) . should ( 'be.focused' ) ;
1715
+ // Table
1716
+ cy . realPress ( 'Tab' ) ;
1717
+ cy . focused ( ) . should ( 'have.attr' , 'ui5-table-row' ) ;
1694
1718
//footer
1695
1719
cy . realPress ( 'Tab' ) ;
1696
1720
cy . findByTestId ( 'footer-accept-btn' ) . should ( 'be.focused' ) ;
1721
+ // Table
1722
+ cy . realPress ( [ 'Shift' , 'Tab' ] ) ;
1723
+ cy . focused ( ) . should ( 'have.attr' , 'ui5-table-row' ) ;
1724
+ // Table Section
1725
+ cy . realPress ( [ 'Shift' , 'Tab' ] ) ;
1726
+ cy . focused ( ) . should ( 'have.attr' , 'aria-label' , 'Table' ) . and ( 'have.attr' , 'tabindex' , 0 ) ;
1697
1727
// 6.2 input
1698
1728
cy . realPress ( [ 'Shift' , 'Tab' ] ) ;
1699
1729
cy . findByTestId ( 'sub' ) . should ( 'be.focused' ) ;
@@ -1730,10 +1760,12 @@ describe('ObjectPage', () => {
1730
1760
cy . get ( '[data-component-name="ObjectPageSubSection"]' ) . should ( 'have.attr' , 'tabindex' , - 1 ) ;
1731
1761
1732
1762
// click first Tab
1733
- cy . focused ( ) . realClick ( ) ;
1763
+ cy . log ( 'click first Tab' ) ;
1764
+ cy . get ( '[ui5-tabcontainer]' ) . findUi5TabByText ( 'Goals' ) . click ( ) ;
1734
1765
cy . focused ( ) . should ( 'have.attr' , 'aria-label' , 'Goals' ) . and ( 'have.attr' , 'tabindex' , 0 ) ;
1735
1766
1736
1767
// arrow section navigation
1768
+ cy . log ( 'arrow section navigation' ) ;
1737
1769
cy . realPress ( 'ArrowUp' ) ;
1738
1770
cy . focused ( ) . should ( 'have.attr' , 'aria-label' , 'Goals' ) . and ( 'have.attr' , 'tabindex' , 0 ) ;
1739
1771
cy . realPress ( 'ArrowDown' ) ;
@@ -1747,9 +1779,25 @@ describe('ObjectPage', () => {
1747
1779
cy . realPress ( 'ArrowDown' ) ;
1748
1780
cy . focused ( ) . should ( 'have.attr' , 'aria-label' , 'SubSectionsInput' ) . and ( 'have.attr' , 'tabindex' , 0 ) ;
1749
1781
cy . realPress ( 'ArrowDown' ) ;
1750
- cy . focused ( ) . should ( 'have.attr' , 'aria-label' , 'SubSectionsInput' ) . and ( 'have.attr' , 'tabindex' , 0 ) ;
1782
+ cy . focused ( )
1783
+ . should ( 'have.attr' , 'aria-label' , 'Table' )
1784
+ . and ( 'have.attr' , 'tabindex' , 0 )
1785
+ . then ( ( $el ) => {
1786
+ const rect = $el [ 0 ] . getBoundingClientRect ( ) ;
1787
+ expect ( rect . top ) . to . be . at . most ( 214 ) ;
1788
+ } ) ;
1789
+ cy . realPress ( 'ArrowDown' ) ;
1790
+ cy . focused ( )
1791
+ . should ( 'have.attr' , 'aria-label' , 'Table' )
1792
+ . and ( 'have.attr' , 'tabindex' , 0 )
1793
+ . then ( ( $el ) => {
1794
+ const rect = $el [ 0 ] . getBoundingClientRect ( ) ;
1795
+ expect ( rect . top ) . to . be . at . most ( 211 ) ;
1796
+ } ) ;
1751
1797
1752
1798
// arrow subsection navigation
1799
+ cy . log ( 'arrow subsection navigation' ) ;
1800
+ cy . realPress ( 'ArrowUp' ) ;
1753
1801
cy . realPress ( 'Tab' ) ;
1754
1802
cy . focused ( ) . should ( 'have.attr' , 'aria-label' , '6.1' ) . and ( 'have.attr' , 'tabindex' , 0 ) ;
1755
1803
cy . realPress ( 'ArrowUp' ) ;
@@ -1777,6 +1825,19 @@ describe('ObjectPage', () => {
1777
1825
cy . wrap ( section ) . should ( 'have.attr' , 'tabindex' , - 1 ) ;
1778
1826
}
1779
1827
} ) ;
1828
+
1829
+ //Table row navigation (relatedTarget not present - scroll-padding fallback)
1830
+ cy . log ( 'Table row navigation' ) ;
1831
+ cy . get ( '[ui5-tabcontainer]' ) . findUi5TabByText ( 'Table' ) . click ( ) ;
1832
+ cy . realPress ( 'Tab' ) ;
1833
+ for ( let i = 0 ; i < 15 ; i ++ ) {
1834
+ cy . realPress ( 'ArrowDown' ) ;
1835
+ }
1836
+ cy . focused ( ) . should ( 'be.visible' ) . and ( 'have.attr' , 'ui5-table-row' ) ;
1837
+ for ( let i = 0 ; i < 13 ; i ++ ) {
1838
+ cy . realPress ( 'ArrowUp' ) ;
1839
+ }
1840
+ cy . focused ( ) . should ( 'be.visible' ) . and ( 'have.attr' , 'ui5-table-row' ) ;
1780
1841
} ) ;
1781
1842
} ) ;
1782
1843
0 commit comments