- |
-
+ | |
+
', () => {
test('launch button shown to users with start capabilities', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('LaunchButton').exists()).toBeTruthy();
});
test('launch button hidden from users without start capabilities', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('LaunchButton').exists()).toBeFalsy();
});
test('edit button shown to users with edit capabilities', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('PencilAltIcon').exists()).toBeTruthy();
});
test('edit button hidden from users without edit capabilities', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('PencilAltIcon').exists()).toBeFalsy();
});
test('missing resource icon is shown.', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(true);
});
test('missing resource icon is not shown when there is a project and an inventory.', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false);
});
test('missing resource icon is not shown when inventory is prompt_on_launch, and a project', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false);
});
test('missing resource icon is not shown type is workflow_job_template', () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false);
});
@@ -171,19 +203,23 @@ describe('', () => {
initialEntries: ['/templates'],
});
const wrapper = mountWithContexts(
- ,
+ ,
{ context: { router: { history } } }
);
wrapper.find('Link').simulate('click', { button: 0 });
@@ -195,11 +231,15 @@ describe('', () => {
JobTemplatesAPI.copy.mockResolvedValue();
const wrapper = mountWithContexts(
-
+
);
await act(async () =>
wrapper.find('Button[aria-label="Copy"]').prop('onClick')()
@@ -212,11 +252,15 @@ describe('', () => {
JobTemplatesAPI.copy.mockRejectedValue(new Error());
const wrapper = mountWithContexts(
-
+
);
await act(async () =>
wrapper.find('Button[aria-label="Copy"]').prop('onClick')()
@@ -228,39 +272,51 @@ describe('', () => {
test('should not render copy button', async () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('CopyButton').length).toBe(0);
});
test('should render visualizer button for workflow', async () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('ProjectDiagramIcon').length).toBe(1);
});
test('should not render visualizer button for job template', async () => {
const wrapper = mountWithContexts(
-
+
);
expect(wrapper.find('ProjectDiagramIcon').length).toBe(0);
});
|