+ |
+
+
+ {executionEnvironment.name}
+
+ |
+
+ {executionEnvironment.image}
+ |
+
+ {executionEnvironment.organization ? (
+
-
-
-
-
-
+ {executionEnvironment?.summary_fields?.organization?.name}
+
+ ) : (
+ i18n._(t`Globally Available`)
+ )}
+ |
+
+
+
+
+
+
);
}
diff --git a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.test.jsx b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.test.jsx
index 4f51a51672..0e7c037aed 100644
--- a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.test.jsx
+++ b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.test.jsx
@@ -8,21 +8,27 @@ import ExecutionEnvironmentListItem from './ExecutionEnvironmentListItem';
describe('', () => {
let wrapper;
const executionEnvironment = {
+ name: 'Foo',
id: 1,
image: 'https://registry.com/r/image/manifest',
organization: null,
credential: null,
+ summary_fields: { user_capabilities: { edit: true } },
};
test('should mount successfully', async () => {
await act(async () => {
wrapper = mountWithContexts(
- {}}
- />
+
);
});
expect(wrapper.find('ExecutionEnvironmentListItem').length).toBe(1);
@@ -31,22 +37,38 @@ describe('', () => {
test('should render the proper data', async () => {
await act(async () => {
wrapper = mountWithContexts(
- {}}
- />
+
);
});
expect(
wrapper
- .find('DataListCell[aria-label="execution environment image"]')
+ .find('Td')
+ .at(1)
+ .text()
+ ).toBe(executionEnvironment.name);
+ expect(
+ wrapper
+ .find('Td')
+ .at(2)
.text()
).toBe(executionEnvironment.image);
- expect(wrapper.find('PencilAltIcon').length).toBe(1);
+
expect(
- wrapper.find('input#select-execution-environment-1').prop('checked')
- ).toBe(false);
+ wrapper
+ .find('Td')
+ .at(3)
+ .text()
+ ).toBe('Globally Available');
+
+ expect(wrapper.find('PencilAltIcon').exists()).toBeTruthy();
});
});