File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,11 +44,14 @@ const useStyles = makeStyles((theme) => ({
4444 flexDirection : 'column' ,
4545 flexGrow : 1 ,
4646 height : '100%' ,
47+ minHeight : 0 ,
4748 } ,
4849 roomList : {
4950 display : 'flex' ,
5051 flexDirection : 'column' ,
5152 flexGrow : 1 ,
53+ height : '100%' ,
54+ minHeight : 0 ,
5255 } ,
5356 roomListContainer : {
5457 display : 'flex' ,
@@ -79,10 +82,12 @@ const useStyles = makeStyles((theme) => ({
7982 display : 'flex' ,
8083 flexDirection : 'column' ,
8184 flexGrow : 1 ,
85+ height : '100%' ,
8286 } ,
8387 flexGrow : {
8488 display : 'flex' ,
8589 flexGrow : 1 ,
90+ minHeight : 0 ,
8691 } ,
8792 bottomNav : {
8893 width : '100%' ,
@@ -147,6 +152,7 @@ function Lobby({
147152 >
148153 < div
149154 className = { classes . roomListContainer }
155+ data-testid = "room-list-scroll-container"
150156 >
151157 < Container
152158 maxWidth = "md"
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ const useStyles = makeStyles((theme) => ({
140140 content : {
141141 display : 'flex' ,
142142 flexGrow : 1 ,
143+ minHeight : 0 ,
143144 flexDirection : 'column' ,
144145 } ,
145146} ) ) ;
Original file line number Diff line number Diff line change @@ -53,6 +53,25 @@ describe('local app stack', () => {
5353 } ) ;
5454 } ) ;
5555
56+ it ( 'scrolls the room list when it exceeds the viewport' , ( ) => {
57+ cy . viewport ( 800 , 500 ) ;
58+ cy . visit ( '/' ) ;
59+
60+ cy . get ( '[data-testid="room-list-scroll-container"]' , { timeout : 10000 } )
61+ . then ( ( $roomList ) => {
62+ const filler = $roomList [ 0 ] . ownerDocument . createElement ( 'div' ) ;
63+ filler . style . flex = '0 0 1000px' ;
64+ $roomList [ 0 ] . appendChild ( filler ) ;
65+ } )
66+ . should ( ( $roomList ) => {
67+ expect ( $roomList [ 0 ] . scrollHeight ) . to . be . greaterThan ( $roomList [ 0 ] . clientHeight ) ;
68+ } )
69+ . scrollTo ( 'bottom' )
70+ . should ( ( $roomList ) => {
71+ expect ( $roomList [ 0 ] . scrollTop ) . to . be . greaterThan ( 0 ) ;
72+ } ) ;
73+ } ) ;
74+
5675 it ( 'renders markdown announcements in the lobby' , ( ) => {
5776 cy . intercept ( 'GET' , '**/api/announcements' , '[Docs](https://example.com)' ) . as ( 'announcements' ) ;
5877
You can’t perform that action at this time.
0 commit comments