mirror of
https://github.com/ansible/awx.git
synced 2026-07-28 08:29:55 -02:30
fix Schedule tests
This commit is contained in:
@@ -42,12 +42,12 @@ describe('<VariablesDetail>', () => {
|
|||||||
expect(input2.prop('value')).toEqual('foo: bar\n');
|
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(
|
const wrapper = mountWithContexts(
|
||||||
<VariablesDetail value="" label="Variables" />
|
<VariablesDetail value="" label="Variables" />
|
||||||
);
|
);
|
||||||
expect(wrapper.find('VariablesDetail___StyledCodeEditor').length).toBe(1);
|
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', () => {
|
test('should update value if prop changes', () => {
|
||||||
|
|||||||
@@ -121,8 +121,8 @@ describe('<Schedule />', () => {
|
|||||||
});
|
});
|
||||||
test('expect all tabs to exist, including Back to Schedules', async () => {
|
test('expect all tabs to exist, including Back to Schedules', async () => {
|
||||||
expect(
|
expect(
|
||||||
wrapper.find('button[link="/templates/job_template/1/schedules"]').length
|
wrapper.find('a[href="/templates/job_template/1/schedules"]').length
|
||||||
).toBe(1);
|
).toBe(1);
|
||||||
expect(wrapper.find('button[aria-label="Details"]').length).toBe(1);
|
expect(wrapper.find('a[aria-label="Details"]').length).toBe(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ describe('ScheduleListItem', () => {
|
|||||||
describe('User has edit permissions', () => {
|
describe('User has edit permissions', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
<ScheduleListItem
|
<ScheduleListItem
|
||||||
isSelected={false}
|
isSelected={false}
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
@@ -57,6 +59,8 @@ describe('ScheduleListItem', () => {
|
|||||||
isMissingSurvey={false}
|
isMissingSurvey={false}
|
||||||
isMissingInventory={false}
|
isMissingInventory={false}
|
||||||
/>
|
/>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -190,6 +194,8 @@ describe('ScheduleListItem', () => {
|
|||||||
describe('schedule has missing prompt data', () => {
|
describe('schedule has missing prompt data', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
<ScheduleListItem
|
<ScheduleListItem
|
||||||
isSelected={false}
|
isSelected={false}
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
@@ -206,6 +212,8 @@ describe('ScheduleListItem', () => {
|
|||||||
isMissingInventory="Inventory Error"
|
isMissingInventory="Inventory Error"
|
||||||
isMissingSurvey="Survey Error"
|
isMissingSurvey="Survey Error"
|
||||||
/>
|
/>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user