Sha256: 1bc16c31e0b05a54b981778c1cd3c1e43388d4179d8a6f51af73a5d51c6f3d4c

Contents?: true

Size: 1.98 KB

Versions: 59

Compression:

Stored size: 1.98 KB

Contents

import { toVars } from '../../../components/AnsibleHostDetail/components/JobsTab/NewRecurringJobHelper';

import {
  scheduledJobsSearch,
  previousJobsSearch,
} from '../../../components/AnsibleHostDetail/components/JobsTab/JobsTabHelper';
import {
  jobInvocationsMockFactory,
  jobCreateMockFactory,
  firstJob,
  secondJob,
  futureDate,
} from '../../../components/AnsibleHostDetail/components/JobsTab/__test__/JobsTab.fixtures';

import { admin } from '../../../testHelper';

export const hgId = 22;
export const matchMock = {
  params: {
    id: '22',
  },
};
export { futureDate };

const emptyScheduledJobsMock = jobInvocationsMockFactory(
  { search: scheduledJobsSearch('hostgroup', hgId) },
  { nodes: [], totalCount: 0 },
  { currentUser: admin }
);
const emptyScheduledJobsRefetchMock = jobInvocationsMockFactory(
  { search: scheduledJobsSearch('hostgroup', hgId) },
  { nodes: [], totalCount: 0 },
  { refetchData: { nodes: [firstJob], totalCount: 1 }, currentUser: admin }
);
const emptyPreviousJobsMock = jobInvocationsMockFactory(
  { search: previousJobsSearch('hostgroup', hgId), first: 20, last: 20 },
  { nodes: [], totalCount: 0 },
  { currentUser: admin }
);
const scheduledJobsMocks = jobInvocationsMockFactory(
  { search: scheduledJobsSearch('hostgroup', hgId) },
  { nodes: [firstJob], totalCount: 1 },
  { currentUser: admin }
);
const previousJobsMocks = jobInvocationsMockFactory(
  { search: previousJobsSearch('hostgroup', hgId), first: 20, last: 20 },
  { nodes: [secondJob], totalCount: 1 },
  { currentUser: admin }
);

export const emptyMocks = emptyScheduledJobsMock.concat(emptyPreviousJobsMock);
export const scheduledAndPreviousMocks = scheduledJobsMocks.concat(
  previousJobsMocks
);

const createJobMock = jobCreateMockFactory(
  toVars('hostgroup', hgId, futureDate, 'weekly').variables,
  { jobInvocation: { id: 'MDE6Sm9iSW52b2NhdGlvbi00MTU=' }, errors: [] }
);

export const createMocks = emptyScheduledJobsRefetchMock
  .concat(emptyPreviousJobsMock)
  .concat(createJobMock);

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
foreman_ansible-12.0.6 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-12.0.5 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-10.4.3 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-12.0.4 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-10.4.2 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-12.0.3 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-12.0.2 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-12.0.1 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-12.0.0 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-11.2.1 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-7.1.7 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-11.2.0 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-11.1.2 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-7.1.6 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-11.1.1 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-10.4.1 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-7.1.5 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-11.1.0 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-10.4.0 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
foreman_ansible-10.3.0 webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js