Tweak Schedules props to include the options request callback needed to load the list after rebasing.

This commit is contained in:
mabashian 2020-03-06 09:37:51 -05:00
parent 90e047821d
commit 314e345825
3 changed files with 19 additions and 4 deletions

View File

@ -3,7 +3,12 @@ import { withI18n } from '@lingui/react';
import { Switch, Route, useRouteMatch } from 'react-router-dom';
import { Schedule, ScheduleList } from '@components/Schedule';
function Schedules({ setBreadcrumb, unifiedJobTemplate, loadSchedules }) {
function Schedules({
setBreadcrumb,
unifiedJobTemplate,
loadSchedules,
loadScheduleOptions,
}) {
const match = useRouteMatch();
return (
@ -22,7 +27,12 @@ function Schedules({ setBreadcrumb, unifiedJobTemplate, loadSchedules }) {
key="list"
path={`${match.path}`}
render={() => {
return <ScheduleList loadSchedules={loadSchedules} />;
return (
<ScheduleList
loadSchedules={loadSchedules}
loadScheduleOptions={loadScheduleOptions}
/>
);
}}
/>
</Switch>

View File

@ -14,7 +14,12 @@ describe('<Schedules />', () => {
await act(async () => {
wrapper = mountWithContexts(
<Schedules setBreadcrumb={() => {}} jobTemplate={jobTemplate} />,
<Schedules
setBreadcrumb={() => {}}
jobTemplate={jobTemplate}
loadSchedules={() => {}}
loadScheduleOptions={() => {}}
/>,
{
context: {

View File

@ -62,7 +62,7 @@ describe('<Template />', () => {
const tabs = await waitForElement(
wrapper,
'.pf-c-tabs__item',
el => el.length === 6
el => el.length === 7
);
expect(tabs.at(2).text()).toEqual('Notifications');
done();