Skip to content

Commit

Permalink
[Automatic Import] Correctly output icons in the manifest (#201139)
Browse files Browse the repository at this point in the history
## Release Note

Fixes a bug in Automatic Import where icons were not shown after the
integration was installed.

## Summary

Closes #201008.

When implementing safe manifest output #192316 a bug crept in:
the icons array was incorrectly output as a dictionary

    icons:
      src: /img/logoElastic.svg
      title: syslog_test3 Logo
      size: 32x32
      type: image/svg+xml

and the test was not smart enough to pick it up:

    expect(manifest.icons).toBeTruthy();

We fix the field and add better tests for it.
  • Loading branch information
ilyannn authored Nov 21, 2024
1 parent 889ce00 commit 30e075a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ describe('renderPackageManifestYAML', () => {
expect(manifest.name).toBe(integration.name);
expect(manifest.type).toBe('integration');
expect(manifest.description).toBe(integration.description);
expect(manifest.icons).toBeTruthy();
expect(Array.isArray(manifest.icons)).toBe(true);
expect((manifest.icons as object[]).length).toBe(1);
expect((manifest.icons as object[])[0]).toEqual({
src: '/img/logo.svg',
title: 'Sample Integration Logo',
size: '32x32',
type: 'image/svg+xml',
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ function createPackageManifestDict(
};

if (package_logo !== undefined && package_logo !== '') {
data.icons = {
src: '/img/logo.svg',
title: `${package_title} Logo`,
size: '32x32',
type: 'image/svg+xml',
};
data.icons = [
{
src: '/img/logo.svg',
title: `${package_title} Logo`,
size: '32x32',
type: 'image/svg+xml',
},
];
}
return data;
}
Expand Down

0 comments on commit 30e075a

Please sign in to comment.