text: import Scenario from './scenarios/empty/scenario';
  import ModelTestHelper from './helper';
  import requirefrom from 'requirefrom';
  
  const wrapAsync = requirefrom('src/test_utils')('wrap_async');
  
  describe('saved_objects_api/functional', function () {
  
    const helper = new ModelTestHelper(60000, 'search', 'title', 'search');
  
    describe('SearchModel', function () {
  
      const expectedMapping = {
        title: {
          type: 'text'
        },
        description: {
          type: 'text'
        },
        columns: {
          type: 'text'
        },
        sort: {
          type: 'text'
        },
        hits: {
          type: 'integer'
        },
        kibanaSavedObjectMeta: {
          properties : {
            searchSourceJSON : {
              type : 'text'
            }
          }
        },
        version: {
          type: 'integer'
        }
      };
  
      beforeEach(wrapAsync(async () => {
        await helper.reload(Scenario);
      }));
  
      it('should throw a ConflictError on creation conflicts.', wrapAsync(async () => {
        return helper.testCreation();
      }));
  
      it('should index a search correctly.', wrapAsync(async () => {
        return helper.testIndexing();
      }));
  
      it('should create mappings when creating a search if they do not exist.', wrapAsync(async () => {
        return helper.testMappingsCreation(expectedMapping);
      }));
  
      it('should create mappings when indexing a search if they do not exist.', wrapAsync(async () => {
        return helper.testMappingsIndexing(expectedMapping);
      }));
  
      it('should not create mappings when creating a search if they already exist.', wrapAsync(async () => {
        return helper.testSkipMappings();
      }));
  
    });
  
  });
  