mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-30 19:52:20 +01:00
(test) fix broken test
This commit is contained in:
parent
856a6fa321
commit
84b28ffddf
@ -18,7 +18,7 @@ declare const Application: IApplication;
|
|||||||
interface EventsSettingsProps {
|
interface EventsSettingsProps {
|
||||||
onError: (message: string) => void,
|
onError: (message: string) => void,
|
||||||
onSuccess: (message: string) => void
|
onSuccess: (message: string) => void
|
||||||
uiRouter: UIRouter
|
uiRouter?: UIRouter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -60,7 +60,7 @@ export const EventsSettings: React.FC<EventsSettingsProps> = ({ onError, onSucce
|
|||||||
<FabButton onClick={handleSubmit(onSubmit)} className='save-btn is-main'>{t('app.admin.events_settings.save')}</FabButton>
|
<FabButton onClick={handleSubmit(onSubmit)} className='save-btn is-main'>{t('app.admin.events_settings.save')}</FabButton>
|
||||||
</header>
|
</header>
|
||||||
<form className="events-settings-content">
|
<form className="events-settings-content">
|
||||||
<UnsavedFormAlert uiRouter={uiRouter} formState={formState} />
|
{uiRouter && <UnsavedFormAlert uiRouter={uiRouter} formState={formState} />}
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
<EditorialBlockForm register={register}
|
<EditorialBlockForm register={register}
|
||||||
control={control}
|
control={control}
|
||||||
|
@ -19,7 +19,7 @@ interface MachinesSettingsProps {
|
|||||||
onError: (message: string) => void,
|
onError: (message: string) => void,
|
||||||
onSuccess: (message: string) => void,
|
onSuccess: (message: string) => void,
|
||||||
beforeSubmit?: (data: Record<SettingName, SettingValue>) => void,
|
beforeSubmit?: (data: Record<SettingName, SettingValue>) => void,
|
||||||
uiRouter: UIRouter
|
uiRouter?: UIRouter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +62,7 @@ export const MachinesSettings: React.FC<MachinesSettingsProps> = ({ onError, onS
|
|||||||
<FabButton onClick={handleSubmit(onSubmit)} className='save-btn is-main'>{t('app.admin.machines_settings.save')}</FabButton>
|
<FabButton onClick={handleSubmit(onSubmit)} className='save-btn is-main'>{t('app.admin.machines_settings.save')}</FabButton>
|
||||||
</header>
|
</header>
|
||||||
<form className="machines-settings-content">
|
<form className="machines-settings-content">
|
||||||
<UnsavedFormAlert uiRouter={uiRouter} formState={formState} />
|
{uiRouter && <UnsavedFormAlert uiRouter={uiRouter} formState={formState} />}
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
<EditorialBlockForm register={register}
|
<EditorialBlockForm register={register}
|
||||||
control={control}
|
control={control}
|
||||||
|
@ -68,7 +68,7 @@ const NotificationsList: React.FC<NotificationsListProps> = ({ onError }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="notifications-list">
|
<div className="notifications-list" data-testid="notifications-list">
|
||||||
<header className="notifications-header">
|
<header className="notifications-header">
|
||||||
<h2 className="title">{t('app.logged.notifications_list.notifications')}</h2>
|
<h2 className="title">{t('app.logged.notifications_list.notifications')}</h2>
|
||||||
{totals.unread > 0 &&
|
{totals.unread > 0 &&
|
||||||
|
@ -21,7 +21,7 @@ declare const Application: IApplication;
|
|||||||
interface TrainingsSettingsProps {
|
interface TrainingsSettingsProps {
|
||||||
onError: (message: string) => void,
|
onError: (message: string) => void,
|
||||||
onSuccess: (message: string) => void,
|
onSuccess: (message: string) => void,
|
||||||
uiRouter: UIRouter
|
uiRouter?: UIRouter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,7 +71,7 @@ export const TrainingsSettings: React.FC<TrainingsSettingsProps> = ({ onError, o
|
|||||||
<FabButton onClick={() => handleSubmit(onSubmit)()} className='save-btn is-main'>{t('app.admin.trainings_settings.save')}</FabButton>
|
<FabButton onClick={() => handleSubmit(onSubmit)()} className='save-btn is-main'>{t('app.admin.trainings_settings.save')}</FabButton>
|
||||||
</header>
|
</header>
|
||||||
<form className="trainings-settings-content">
|
<form className="trainings-settings-content">
|
||||||
<UnsavedFormAlert uiRouter={uiRouter} formState={formState} />
|
{uiRouter && <UnsavedFormAlert uiRouter={uiRouter} formState={formState} />}
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
<EditorialBlockForm register={register}
|
<EditorialBlockForm register={register}
|
||||||
control={control}
|
control={control}
|
||||||
|
0
test/frontend/__fixtures__/notification_types.ts
Normal file
0
test/frontend/__fixtures__/notification_types.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { render, screen, waitFor } from '@testing-library/react';
|
||||||
|
import { NotificationsList } from '../../../../app/frontend/src/javascript/components/notifications/notifications-list';
|
||||||
|
|
||||||
|
// Notifications list in Notification Center
|
||||||
|
describe('Notifications list', () => {
|
||||||
|
test('should render the correct list', async () => {
|
||||||
|
const onError = jest.fn();
|
||||||
|
|
||||||
|
render(<NotificationsList onError={onError} />);
|
||||||
|
await waitFor(() => screen.getByTestId('notifications-list'));
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user