Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalczyk-krzysztof committed Oct 23, 2024
1 parent 82b7be3 commit c8b4fda
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const convertType = (type: string): SavedObjectManagementTypeInfo => ({
namespaceType: 'single',
});

const allowedTypes = ['index-pattern', 'visualization', 'dashboard', 'search'].map(convertType);
const allowedTypes = ['index-pattern', 'visualization', 'dashboard', 'search', 'tag'].map(
convertType
);

const allSavedObjects = [
{
Expand Down Expand Up @@ -82,6 +84,13 @@ const allSavedObjects = [
title: `MyViz`,
},
},
{
id: '5',
type: 'tag',
attributes: {
title: `HelloWorldTag`,
},
},
];

describe('SavedObjectsTable', () => {
Expand Down Expand Up @@ -129,6 +138,7 @@ describe('SavedObjectsTable', () => {
visualization: 0,
dashboard: 0,
search: 0,
tag: 0,
});

defaultProps = {
Expand All @@ -148,7 +158,7 @@ describe('SavedObjectsTable', () => {
};

findObjectsMock.mockImplementation(() => ({
total: 4,
total: 5,
saved_objects: [
{
id: '1',
Expand Down Expand Up @@ -199,6 +209,14 @@ describe('SavedObjectsTable', () => {
},
},
},
{
id: '5',
type: 'tag',
meta: {
title: `HelloWorldTag`,
icon: 'tag',
},
},
],
}));
});
Expand Down Expand Up @@ -451,7 +469,7 @@ describe('SavedObjectsTable', () => {
component.update();

await component.instance().getRelationships('search', '1');
const savedObjectTypes = ['index-pattern', 'visualization', 'dashboard', 'search'];
const savedObjectTypes = ['index-pattern', 'visualization', 'dashboard', 'search', 'tag'];
expect(getRelationshipsMock).toHaveBeenCalledWith(http, 'search', '1', savedObjectTypes);
});

Expand Down

0 comments on commit c8b4fda

Please sign in to comment.