Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions client/src/components/Lobby/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { connect, useDispatch } from 'react-redux';
import { Link } from 'react-router-dom';
import clsx from 'clsx';

Check warning on line 4 in client/src/components/Lobby/index.jsx

View workflow job for this annotation

GitHub Actions / Client lint and unit tests

Using exported name 'clsx' as identifier for default import

Check warning on line 4 in client/src/components/Lobby/index.jsx

View workflow job for this annotation

GitHub Actions / Client lint and unit tests

Using exported name 'clsx' as identifier for default import
import PropTypes from 'prop-types';
import { makeStyles } from '@mui/styles';
import Paper from '@mui/material/Paper';
Expand Down Expand Up @@ -44,11 +44,14 @@
flexDirection: 'column',
flexGrow: 1,
height: '100%',
minHeight: 0,
},
roomList: {
display: 'flex',
flexDirection: 'column',
flexGrow: 1,
height: '100%',
minHeight: 0,
},
roomListContainer: {
display: 'flex',
Expand Down Expand Up @@ -79,10 +82,12 @@
display: 'flex',
flexDirection: 'column',
flexGrow: 1,
height: '100%',
},
flexGrow: {
display: 'flex',
flexGrow: 1,
minHeight: 0,
},
bottomNav: {
width: '100%',
Expand Down Expand Up @@ -147,6 +152,7 @@
>
<div
className={classes.roomListContainer}
data-testid="room-list-scroll-container"
>
<Container
maxWidth="md"
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ const useStyles = makeStyles((theme) => ({
content: {
display: 'flex',
flexGrow: 1,
minHeight: 0,
flexDirection: 'column',
},
}));
Expand Down
19 changes: 19 additions & 0 deletions cypress/e2e/local_stack.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ describe('local app stack', () => {
});
});

it('scrolls the room list when it exceeds the viewport', () => {
cy.viewport(800, 500);
cy.visit('/');

cy.get('[data-testid="room-list-scroll-container"]', { timeout: 10000 })
.then(($roomList) => {
const filler = $roomList[0].ownerDocument.createElement('div');
filler.style.flex = '0 0 1000px';
$roomList[0].appendChild(filler);
})
.should(($roomList) => {
expect($roomList[0].scrollHeight).to.be.greaterThan($roomList[0].clientHeight);
})
.scrollTo('bottom')
.should(($roomList) => {
expect($roomList[0].scrollTop).to.be.greaterThan(0);
});
});

it('renders markdown announcements in the lobby', () => {
cy.intercept('GET', '**/api/announcements', '[Docs](https://example.com)').as('announcements');

Expand Down
Loading