Fix broken link for inventory

Fix broke link for inventory

See: https://github.com/ansible/awx/issues/11111
This commit is contained in:
nixocio 2021-09-22 14:29:39 -04:00
parent 9be8fba63d
commit ee4b47595a
2 changed files with 5 additions and 1 deletions

View File

@ -124,7 +124,7 @@ function PromptJobTemplateDetail({ resource }) {
label={t`Inventory`}
value={
<Link
to={`/${inventoryKind}/${summary_fields.inventory?.id}/details`}
to={`/inventories/${inventoryKind}/${summary_fields.inventory?.id}/details`}
>
{summary_fields.inventory?.name}
</Link>

View File

@ -37,6 +37,10 @@ describe('PromptJobTemplateDetail', () => {
test('should render expected details', () => {
assertDetail(wrapper, 'Job Type', 'Run');
assertDetail(wrapper, 'Inventory', 'Demo Inventory');
const link = wrapper.find('Detail[label="Inventory"]');
expect(link.find('Link').prop('to')).toBe(
'/inventories/inventory/1/details'
);
assertDetail(wrapper, 'Project', 'Mock Project');
assertDetail(wrapper, 'Source Control Branch', 'Foo branch');
assertDetail(wrapper, 'Playbook', 'ping.yml');