Skip to content

Commit

Permalink
fix so_mixin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Mar 6, 2020
1 parent b130e59 commit c18b248
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/legacy/server/saved_objects/saved_objects_mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('Saved Objects Mixin', () => {

it('should return all but hidden types', async () => {
expect(service).toBeDefined();
expect(service.types).toEqual(['config', 'testtype', 'doc1', 'doc2']);
expect(service.types).toEqual(['testtype', 'doc1', 'doc2']);
});

const mockCallEs = jest.fn();
Expand All @@ -215,30 +215,20 @@ describe('Saved Objects Mixin', () => {
it('should create a repository without hidden types', () => {
const repository = service.getSavedObjectsRepository(mockCallEs);
expect(repository).toBeDefined();
expect(repository._allowedTypes).toEqual(['config', 'testtype', 'doc1', 'doc2']);
expect(repository._allowedTypes).toEqual(['testtype', 'doc1', 'doc2']);
});

it('should create a repository with a unique list of allowed types', () => {
const repository = service.getSavedObjectsRepository(mockCallEs, [
'config',
'config',
'config',
]);
expect(repository._allowedTypes).toEqual(['config', 'testtype', 'doc1', 'doc2']);
const repository = service.getSavedObjectsRepository(mockCallEs, ['doc1', 'doc1', 'doc1']);
expect(repository._allowedTypes).toEqual(['testtype', 'doc1', 'doc2']);
});

it('should create a repository with extraTypes minus duplicate', () => {
const repository = service.getSavedObjectsRepository(mockCallEs, [
'hiddentype',
'hiddentype',
]);
expect(repository._allowedTypes).toEqual([
'config',
'testtype',
'doc1',
'doc2',
'hiddentype',
]);
expect(repository._allowedTypes).toEqual(['testtype', 'doc1', 'doc2', 'hiddentype']);
});

it('should not allow a repository without a callCluster function', () => {
Expand Down

0 comments on commit c18b248

Please sign in to comment.