fix Schedule tests

This commit is contained in:
Keith J. Grant
2021-04-12 09:42:36 -07:00
parent 445b2fef84
commit 79118cfbe2
3 changed files with 35 additions and 27 deletions

View File

@@ -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', () => {

View File

@@ -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);
}); });
}); });

View File

@@ -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>
); );
}); });