test: add page title test ids to await and await mounting loader components
This commit is contained in:
@@ -11,15 +11,21 @@ import DeleteIcon from '@mui/icons-material/Delete';
|
||||
type ListLoaderProps = {
|
||||
rowsNumber: number;
|
||||
columnsNumber: number;
|
||||
'data-test'?: string;
|
||||
};
|
||||
|
||||
const ListLoader = ({ rowsNumber, columnsNumber }: ListLoaderProps) => {
|
||||
const ListLoader = ({
|
||||
rowsNumber,
|
||||
columnsNumber,
|
||||
'data-test': dataTest,
|
||||
}: ListLoaderProps) => {
|
||||
return (
|
||||
<>
|
||||
{[...Array(rowsNumber)].map((row, index) => (
|
||||
<TableRow
|
||||
key={index}
|
||||
sx={{ '&:last-child td, &:last-child th': { border: 0 } }}
|
||||
data-test={dataTest && index === 0 ? dataTest : undefined}
|
||||
>
|
||||
{[...Array(columnsNumber)].map((cell, index) => (
|
||||
<TableCell key={index} scope="row">
|
||||
|
@@ -44,6 +44,7 @@ function LoginForm() {
|
||||
<Typography
|
||||
variant="h3"
|
||||
align="center"
|
||||
data-test="login-form-title"
|
||||
sx={{
|
||||
borderBottom: '1px solid',
|
||||
borderColor: (theme) => theme.palette.text.disabled,
|
||||
@@ -78,13 +79,15 @@ function LoginForm() {
|
||||
sx={{ mb: 1 }}
|
||||
/>
|
||||
|
||||
{isCloud && <Link
|
||||
component={RouterLink}
|
||||
to={URLS.FORGOT_PASSWORD}
|
||||
underline="none"
|
||||
>
|
||||
{formatMessage('loginForm.forgotPasswordText')}
|
||||
</Link>}
|
||||
{isCloud && (
|
||||
<Link
|
||||
component={RouterLink}
|
||||
to={URLS.FORGOT_PASSWORD}
|
||||
underline="none"
|
||||
>
|
||||
{formatMessage('loginForm.forgotPasswordText')}
|
||||
</Link>
|
||||
)}
|
||||
|
||||
<LoadingButton
|
||||
type="submit"
|
||||
@@ -98,13 +101,15 @@ function LoginForm() {
|
||||
{formatMessage('loginForm.submit')}
|
||||
</LoadingButton>
|
||||
|
||||
{isCloud && <Typography variant="body1" align="center" mt={3}>
|
||||
{formatMessage('loginForm.noAccount')}
|
||||
|
||||
<Link component={RouterLink} to={URLS.SIGNUP} underline="none">
|
||||
{formatMessage('loginForm.signUp')}
|
||||
</Link>
|
||||
</Typography>}
|
||||
{isCloud && (
|
||||
<Typography variant="body1" align="center" mt={3}>
|
||||
{formatMessage('loginForm.noAccount')}
|
||||
|
||||
<Link component={RouterLink} to={URLS.SIGNUP} underline="none">
|
||||
{formatMessage('loginForm.signUp')}
|
||||
</Link>
|
||||
</Typography>
|
||||
)}
|
||||
</Form>
|
||||
</Paper>
|
||||
);
|
||||
|
@@ -4,5 +4,5 @@ import Typography, { TypographyProps } from '@mui/material/Typography';
|
||||
type PageTitleProps = TypographyProps;
|
||||
|
||||
export default function PageTitle(props: PageTitleProps): React.ReactElement {
|
||||
return <Typography variant="h3" {...props} />;
|
||||
return <Typography variant="h3" data-test="page-title" {...props} />;
|
||||
}
|
||||
|
Reference in New Issue
Block a user