mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
fix Schedule tests
This commit is contained in:
parent
445b2fef84
commit
79118cfbe2
@ -42,12 +42,12 @@ describe('<VariablesDetail>', () => {
|
||||
expect(input2.prop('value')).toEqual('foo: bar\n');
|
||||
});
|
||||
|
||||
test('should render label and value= --- when there are no values', () => {
|
||||
test('should render label and value --- when there are no values', () => {
|
||||
const wrapper = mountWithContexts(
|
||||
<VariablesDetail value="" label="Variables" />
|
||||
);
|
||||
expect(wrapper.find('VariablesDetail___StyledCodeEditor').length).toBe(1);
|
||||
expect(wrapper.find('div.pf-c-form__label').text()).toBe('Variables');
|
||||
expect(wrapper.find('.pf-c-form__label').text()).toBe('Variables');
|
||||
});
|
||||
|
||||
test('should update value if prop changes', () => {
|
||||
|
||||
@ -121,8 +121,8 @@ describe('<Schedule />', () => {
|
||||
});
|
||||
test('expect all tabs to exist, including Back to Schedules', async () => {
|
||||
expect(
|
||||
wrapper.find('button[link="/templates/job_template/1/schedules"]').length
|
||||
wrapper.find('a[href="/templates/job_template/1/schedules"]').length
|
||||
).toBe(1);
|
||||
expect(wrapper.find('button[aria-label="Details"]').length).toBe(1);
|
||||
expect(wrapper.find('a[aria-label="Details"]').length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
@ -50,13 +50,17 @@ describe('ScheduleListItem', () => {
|
||||
describe('User has edit permissions', () => {
|
||||
beforeAll(() => {
|
||||
wrapper = mountWithContexts(
|
||||
<ScheduleListItem
|
||||
isSelected={false}
|
||||
onSelect={onSelect}
|
||||
schedule={mockSchedule}
|
||||
isMissingSurvey={false}
|
||||
isMissingInventory={false}
|
||||
/>
|
||||
<table>
|
||||
<tbody>
|
||||
<ScheduleListItem
|
||||
isSelected={false}
|
||||
onSelect={onSelect}
|
||||
schedule={mockSchedule}
|
||||
isMissingSurvey={false}
|
||||
isMissingInventory={false}
|
||||
/>
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
});
|
||||
|
||||
@ -190,22 +194,26 @@ describe('ScheduleListItem', () => {
|
||||
describe('schedule has missing prompt data', () => {
|
||||
beforeAll(() => {
|
||||
wrapper = mountWithContexts(
|
||||
<ScheduleListItem
|
||||
isSelected={false}
|
||||
onSelect={onSelect}
|
||||
schedule={{
|
||||
...mockSchedule,
|
||||
summary_fields: {
|
||||
...mockSchedule.summary_fields,
|
||||
user_capabilities: {
|
||||
edit: false,
|
||||
delete: false,
|
||||
},
|
||||
},
|
||||
}}
|
||||
isMissingInventory="Inventory Error"
|
||||
isMissingSurvey="Survey Error"
|
||||
/>
|
||||
<table>
|
||||
<tbody>
|
||||
<ScheduleListItem
|
||||
isSelected={false}
|
||||
onSelect={onSelect}
|
||||
schedule={{
|
||||
...mockSchedule,
|
||||
summary_fields: {
|
||||
...mockSchedule.summary_fields,
|
||||
user_capabilities: {
|
||||
edit: false,
|
||||
delete: false,
|
||||
},
|
||||
},
|
||||
}}
|
||||
isMissingInventory="Inventory Error"
|
||||
isMissingSurvey="Survey Error"
|
||||
/>
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user