test: add applications settings tests

This commit is contained in:
Jakub P.
2024-09-10 22:00:49 +02:00
committed by Ali BARIN
parent e146793d32
commit 09b2b7350c
14 changed files with 407 additions and 31 deletions

View File

@@ -49,6 +49,7 @@ function AdminApplicationAuthClientDialog(props) {
) : (
<DialogContentText tabIndex={-1} component="div">
<Form
data-test="auth-client-form"
onSubmit={submitHandler}
defaultValues={defaultValues}
render={({ formState: { isDirty } }) => (
@@ -67,6 +68,7 @@ function AdminApplicationAuthClientDialog(props) {
<InputCreator key={field.key} schema={field} />
))}
<LoadingButton
data-test="submit-auth-client-form"
type="submit"
variant="contained"
color="primary"

View File

@@ -43,7 +43,7 @@ function AdminApplicationAuthClients(props) {
return (
<div>
{sortedAuthClients.map((client) => (
<Card sx={{ mb: 1 }} key={client.id}>
<Card sx={{ mb: 1 }} key={client.id} data-test="auth-client">
<CardActionArea
component={Link}
to={URLS.ADMIN_APP_AUTH_CLIENT(appKey, client.id)}
@@ -70,7 +70,7 @@ function AdminApplicationAuthClients(props) {
))}
<Stack justifyContent="flex-end" direction="row">
<Link to={URLS.ADMIN_APP_AUTH_CLIENTS_CREATE(appKey)}>
<Button variant="contained" sx={{ mt: 2 }} component="div">
<Button variant="contained" sx={{ mt: 2 }} component="div" data-test="create-auth-client-button">
{formatMessage('createAuthClient.button')}
</Button>
</Link>

View File

@@ -87,6 +87,7 @@ function AdminApplicationSettings(props) {
</Stack>
<Stack>
<LoadingButton
data-test="submit-button"
type="submit"
variant="contained"
color="primary"

View File

@@ -21,7 +21,7 @@ function NoResultFound(props) {
);
return (
<Card elevation={0}>
<Card elevation={0} data-test="no-results">
<CardActionArea component={ActionAreaLink} {...props}>
<CardContent>
{!!to && <AddCircleIcon color="primary" />}

View File

@@ -42,6 +42,7 @@ function Switch(props) {
{...FormControlLabelProps}
control={
<MuiSwitch
data-test="switch"
{...switchProps}
{...field}
checked={value}