Merge pull request #11115 from nixocio/ui_issue_11111

Fix broken link for inventory
This commit is contained in:
Kersom 2021-09-22 16:47:29 -04:00 committed by GitHub
commit a75c10f447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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');