Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,31 @@ jest.mock('../../services/epm/packages/get', () => ({
},
{
attributes: {
name: 'custom-package',
name: 'bundled-package',
version: '0.1.0',
updated_at: new Date().toISOString(),
install_status: 'installed',
install_source: 'bundled',
},
},
{
attributes: {
name: 'custom-package-1',
version: '0.1.0',
updated_at: new Date().toISOString(),
install_status: 'installed',
install_source: 'upload',
},
},
{
attributes: {
name: 'custom-package-2',
version: '0.1.0',
updated_at: new Date().toISOString(),
install_status: 'installed',
install_source: 'custom',
},
},
],
}),
}));
Expand Down Expand Up @@ -207,7 +225,7 @@ describe('SyncIntegrationsTask', () => {
expect(result).toEqual(getDeleteTaskRunResult());
});

it('Should create fleet-synced-integrations doc for packages installed from registry', async () => {
it('Should create fleet-synced-integrations doc for bundled packages and packages installed from registry', async () => {
mockOutputService.list.mockResolvedValue({
items: [
{
Expand Down Expand Up @@ -269,6 +287,13 @@ describe('SyncIntegrationsTask', () => {
install_status: 'installed',
install_source: 'registry',
},
{
package_name: 'bundled-package',
package_version: '0.1.0',
updated_at: expect.any(String),
install_status: 'installed',
install_source: 'bundled',
},
],
remote_es_hosts: [
{
Expand Down Expand Up @@ -354,6 +379,13 @@ describe('SyncIntegrationsTask', () => {
install_status: 'installed',
install_source: 'registry',
},
{
package_name: 'bundled-package',
package_version: '0.1.0',
updated_at: expect.any(String),
install_status: 'installed',
install_source: 'bundled',
},
],
remote_es_hosts: [
{
Expand Down Expand Up @@ -527,6 +559,13 @@ describe('SyncIntegrationsTask', () => {
install_status: 'installed',
install_source: 'registry',
},
{
package_name: 'bundled-package',
package_version: '0.1.0',
updated_at: expect.any(String),
install_status: 'installed',
install_source: 'bundled',
},
{
package_name: 'package-3',
package_version: '0.3.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ export class SyncIntegrationsTask {
sortOrder: 'asc',
});
newDoc.integrations = packageSavedObjects.saved_objects
.filter((item) => item.attributes.install_source === 'registry')
.filter(
(item) =>
item.attributes.install_source === 'registry' ||
item.attributes.install_source === 'bundled'
) // not included install sources: 'custom' and 'upload'
.map((item) => {
return {
package_name: item.attributes.name,
Expand Down
Loading