mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 18:21:03 -03:30
Add name/description to mock resources in tests
This commit is contained in:
@@ -66,6 +66,8 @@ describe('<ScheduleAdd />', () => {
|
|||||||
type: 'job_template',
|
type: 'job_template',
|
||||||
inventory: 2,
|
inventory: 2,
|
||||||
summary_fields: { credentials: [] },
|
summary_fields: { credentials: [] },
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
}}
|
}}
|
||||||
launchConfig={launchConfig}
|
launchConfig={launchConfig}
|
||||||
/>
|
/>
|
||||||
@@ -417,6 +419,8 @@ describe('<ScheduleAdd />', () => {
|
|||||||
type: 'job_template',
|
type: 'job_template',
|
||||||
inventory: 2,
|
inventory: 2,
|
||||||
summary_fields: { credentials: [] },
|
summary_fields: { credentials: [] },
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
}}
|
}}
|
||||||
launchConfig={launchConfig}
|
launchConfig={launchConfig}
|
||||||
surveyConfig={{
|
surveyConfig={{
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ describe('<ScheduleEdit />', () => {
|
|||||||
{ name: 'job template credential', id: 75, kind: 'ssh' },
|
{ name: 'job template credential', id: 75, kind: 'ssh' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
}}
|
}}
|
||||||
resourceDefaultCredentials={[]}
|
resourceDefaultCredentials={[]}
|
||||||
launchConfig={{
|
launchConfig={{
|
||||||
@@ -654,6 +656,8 @@ describe('<ScheduleEdit />', () => {
|
|||||||
{ name: 'job template credential', id: 75, kind: 'ssh' },
|
{ name: 'job template credential', id: 75, kind: 'ssh' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
}}
|
}}
|
||||||
resourceDefaultCredentials={[]}
|
resourceDefaultCredentials={[]}
|
||||||
launchConfig={{
|
launchConfig={{
|
||||||
|
|||||||
@@ -150,7 +150,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
description: '',
|
description: '',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -199,7 +204,13 @@ describe('<ScheduleForm />', () => {
|
|||||||
description: '',
|
description: '',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
resource={{ id: 23, type: 'job_template', inventory: 1 }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
inventory: 1,
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -232,6 +243,8 @@ describe('<ScheduleForm />', () => {
|
|||||||
summary_fields: {
|
summary_fields: {
|
||||||
credentials: [],
|
credentials: [],
|
||||||
},
|
},
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
}}
|
}}
|
||||||
launchConfig={{
|
launchConfig={{
|
||||||
can_start_without_user_input: false,
|
can_start_without_user_input: false,
|
||||||
@@ -370,6 +383,8 @@ describe('<ScheduleForm />', () => {
|
|||||||
resource={{
|
resource={{
|
||||||
id: 23,
|
id: 23,
|
||||||
type: 'job_template',
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
}}
|
}}
|
||||||
launchConfig={{
|
launchConfig={{
|
||||||
can_start_without_user_input: false,
|
can_start_without_user_input: false,
|
||||||
@@ -422,7 +437,13 @@ describe('<ScheduleForm />', () => {
|
|||||||
<ScheduleForm
|
<ScheduleForm
|
||||||
handleSubmit={jest.fn()}
|
handleSubmit={jest.fn()}
|
||||||
handleCancel={jest.fn()}
|
handleCancel={jest.fn()}
|
||||||
resource={{ id: 23, type: 'job_template', inventory: 1 }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
inventory: 1,
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
launchConfig={{
|
launchConfig={{
|
||||||
can_start_without_user_input: true,
|
can_start_without_user_input: true,
|
||||||
passwords_needed_to_start: [],
|
passwords_needed_to_start: [],
|
||||||
@@ -758,7 +779,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
handleSubmit={jest.fn()}
|
handleSubmit={jest.fn()}
|
||||||
handleCancel={jest.fn()}
|
handleCancel={jest.fn()}
|
||||||
schedule={{ inventory: null, ...mockSchedule }}
|
schedule={{ inventory: null, ...mockSchedule }}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
launchConfig={{
|
launchConfig={{
|
||||||
can_start_without_user_input: true,
|
can_start_without_user_input: true,
|
||||||
passwords_needed_to_start: [],
|
passwords_needed_to_start: [],
|
||||||
@@ -794,7 +820,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
<ScheduleForm
|
<ScheduleForm
|
||||||
handleSubmit={jest.fn()}
|
handleSubmit={jest.fn()}
|
||||||
handleCancel={jest.fn()}
|
handleCancel={jest.fn()}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
launchConfig={{
|
launchConfig={{
|
||||||
can_start_without_user_input: true,
|
can_start_without_user_input: true,
|
||||||
passwords_needed_to_start: [],
|
passwords_needed_to_start: [],
|
||||||
@@ -835,6 +866,8 @@ describe('<ScheduleForm />', () => {
|
|||||||
id: 23,
|
id: 23,
|
||||||
type: 'project',
|
type: 'project',
|
||||||
inventory: 2,
|
inventory: 2,
|
||||||
|
name: 'Foo Project',
|
||||||
|
description: '',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -858,7 +891,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
handleCancel={jest.fn()}
|
handleCancel={jest.fn()}
|
||||||
schedule={mockSchedule}
|
schedule={mockSchedule}
|
||||||
launchConfig={{ inventory_needed_to_start: false }}
|
launchConfig={{ inventory_needed_to_start: false }}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -888,7 +926,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
'DTSTART;TZID=America/New_York:20200402T144500 RRULE:INTERVAL=10;FREQ=MINUTELY',
|
'DTSTART;TZID=America/New_York:20200402T144500 RRULE:INTERVAL=10;FREQ=MINUTELY',
|
||||||
dtend: null,
|
dtend: null,
|
||||||
})}
|
})}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -923,7 +966,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
dtend: '2020-04-03T03:45:00Z',
|
dtend: '2020-04-03T03:45:00Z',
|
||||||
until: '',
|
until: '',
|
||||||
})}
|
})}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -959,7 +1007,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
dtend: null,
|
dtend: null,
|
||||||
until: '',
|
until: '',
|
||||||
})}
|
})}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
expect(wrapper.find('ScheduleForm').length).toBe(1);
|
expect(wrapper.find('ScheduleForm').length).toBe(1);
|
||||||
@@ -994,7 +1047,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
dtend: '2020-10-30T18:45:00Z',
|
dtend: '2020-10-30T18:45:00Z',
|
||||||
until: '2021-01-01T00:00:00',
|
until: '2021-01-01T00:00:00',
|
||||||
})}
|
})}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -1053,7 +1111,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
dtend: null,
|
dtend: null,
|
||||||
until: '',
|
until: '',
|
||||||
})}
|
})}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
expect(wrapper.find('ScheduleForm').length).toBe(1);
|
expect(wrapper.find('ScheduleForm').length).toBe(1);
|
||||||
@@ -1100,7 +1163,12 @@ describe('<ScheduleForm />', () => {
|
|||||||
dtend: null,
|
dtend: null,
|
||||||
until: '',
|
until: '',
|
||||||
})}
|
})}
|
||||||
resource={{ id: 23, type: 'job_template' }}
|
resource={{
|
||||||
|
id: 23,
|
||||||
|
type: 'job_template',
|
||||||
|
name: 'Foo Job Template',
|
||||||
|
description: '',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
expect(wrapper.find('ScheduleForm').length).toBe(1);
|
expect(wrapper.find('ScheduleForm').length).toBe(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user