mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[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:
parent
889ce000eb
commit
30e075a1b6
2 changed files with 16 additions and 7 deletions
|
@ -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',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue