Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions webpack/JobInvocationDetail/JobAdditionInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
DataListItemRow,
} from '@patternfly/react-core';
import { translate as __ } from 'foremanReact/common/I18n';
import Slot from 'foremanReact/components/common/Slot';
import { TARGETING_TYPES } from './JobInvocationConstants';

const ItemsParser = ({ items }) => (
Expand Down Expand Up @@ -188,12 +189,14 @@ const Inputs = ({ data }) => {
</ExpandableSection>
);
};

export const JobAdditionInfo = ({ data }) => (
<>
<Recurring data={data} />
<TargetHosts data={data} />
<Inputs data={data} />
<Schedule data={data} />
<Slot id="job-invocation-additional-info" data={data} />
</>
);

Expand Down
15 changes: 15 additions & 0 deletions webpack/JobInvocationDetail/__tests__/MainInformation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ import {

jest.spyOn(api, 'get');

// Mock toLocaleString to always use UTC timezone for consistent test results
const originalToLocaleString = Date.prototype.toLocaleString;
beforeAll(() => {
// eslint-disable-next-line no-extend-native
Date.prototype.toLocaleString = function (locale, options) {
return originalToLocaleString.call(this, locale, { ...options, timeZone: 'UTC' });
};
});
afterAll(() => {
// eslint-disable-next-line no-extend-native
Date.prototype.toLocaleString = originalToLocaleString;
});

jest.mock('foremanReact/common/hooks/API/APIHooks', () => ({
useAPI: jest.fn(() => ({
response: mockPermissionsData,
Expand All @@ -52,12 +65,14 @@ const initialState = {
response: jobInvocationData,
},
GET_REPORT_TEMPLATES: mockReportTemplatesResponse,
extendable: {},
};

const initialStateScheduled = {
JOB_INVOCATION_KEY: {
response: jobInvocationDataScheduled,
},
extendable: {},
};

api.get.mockImplementation(({ handleSuccess, ...action }) => {
Expand Down