[Automatic Import] Correctly output icons in the manifest (#201139)

## 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.
This commit is contained in:
Ilya Nikokoshev 2024-11-21 16:34:07 +01:00 committed by GitHub
parent 889ce000eb
commit 30e075a1b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 7 deletions

View file

@ -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',
});
});
});

View file

@ -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;
}