Skip to content

Commit 67070e1

Browse files
Test with data-testids (#811)
1 parent 288a188 commit 67070e1

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

src/components/authentication/Login.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ export function Login({ onLoginClick, disabled }: LoginProps) {
4545
<FormattedMessage id="login/login" defaultMessage="login" /> ?
4646
</Typography>
4747

48-
<Button disabled={disabled} fullWidth variant="contained" sx={styles.submit} onClick={onLoginClick}>
48+
<Button
49+
data-testid="LoginButton"
50+
disabled={disabled}
51+
fullWidth
52+
variant="contained"
53+
sx={styles.submit}
54+
onClick={onLoginClick}
55+
>
4956
<FormattedMessage id="login/connection" defaultMessage="connection" />
5057
</Button>
5158
</Box>

src/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export function DescriptionModificationDialog({
8989
label="descriptionProperty"
9090
minRows={3}
9191
rows={3}
92+
data-testid="DescriptionInputField"
9293
/>
9394
</Box>
9495
</CustomMuiDialog>

src/components/inputs/reactHookForm/text/DescriptionField.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export function DescriptionField({ expandingTextSx }: Readonly<DescriptionFieldP
5151
minRows={3}
5252
rows={3}
5353
sx={expandingTextSx}
54+
data-testid="DescriptionInputField"
5455
/>
5556
<Button
5657
sx={{

src/components/inputs/reactHookForm/utils/CancelButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { FormattedMessage } from 'react-intl';
1111
export function CancelButton(inProps: Readonly<Omit<ButtonProps, 'children'>>) {
1212
const props = useThemeProps({ props: inProps, name: 'CancelButton' });
1313
return (
14-
<Button {...props}>
14+
<Button data-testid="CancelButton" {...props}>
1515
<FormattedMessage id="cancel" />
1616
</Button>
1717
);

src/components/topBar/TopBar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ export function TopBar({
295295
aria-haspopup="true"
296296
onClick={handleClickAppsMenu}
297297
color="inherit"
298+
data-testid="AppsMenu"
298299
>
299300
<AppsIcon />
300301
</IconButton>
@@ -351,6 +352,7 @@ export function TopBar({
351352
onClick={handleToggleSettingsMenu}
352353
color="inherit"
353354
style={anchorElSettingsMenu ? { cursor: 'initial' } : { cursor: 'pointer' }}
355+
data-testid="SettingsMenu"
354356
>
355357
<Box component="span" sx={styles.name}>
356358
{user.profile.name !== undefined ? abbreviationFromUserName(user.profile.name) : ''}

src/components/treeViewFinder/TreeViewFinder.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,10 @@ function TreeViewFinderComponant(props: Readonly<TreeViewFinderProps>) {
449449
}}
450450
aria-labelledby="TreeViewFindertitle"
451451
className={className}
452-
classes={{
453-
paper: composeClasses(classes, cssDialogPaper),
454-
}}
452+
classes={{ paper: composeClasses(classes, cssDialogPaper) }}
453+
data-testid="Dialog"
455454
>
456-
<DialogTitle id="TreeViewFindertitle">
455+
<DialogTitle id="TreeViewFindertitle" data-testid="DialogTitle">
457456
{title ?? intl.formatMessage({ id: 'treeview_finder/finderTitle' }, { multiSelect })}
458457
</DialogTitle>
459458
<DialogContent>
@@ -490,6 +489,7 @@ function TreeViewFinderComponant(props: Readonly<TreeViewFinderProps>) {
490489
setAutoScrollAllowed(true);
491490
}}
492491
disabled={isValidationDisabled()}
492+
data-testid="SubmitButton"
493493
>
494494
{getValidationButtonText()}
495495
</Button>

0 commit comments

Comments
 (0)