text: import $ from 'jquery';
  import _ from 'lodash';
  import expect from 'expect.js';
  import ngMock from 'ng_mock';
  import RegistryFieldFormatsProvider from 'ui/registry/field_formats';
  import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
  import FixturesHitsProvider from 'fixtures/hits';
  describe('_source formatting', function () {
  
    let fieldFormats;
  
    beforeEach(ngMock.module('kibana'));
    beforeEach(ngMock.inject(function (Private) {
      fieldFormats = Private(RegistryFieldFormatsProvider);
    }));
  
    describe('Source format', function () {
      let indexPattern;
      let hits;
      let format;
      let convertHtml;
  
      beforeEach(ngMock.inject(function (Private) {
        indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
        hits = Private(FixturesHitsProvider);
        format = fieldFormats.getInstance('_source');
        convertHtml = format.getConverterFor('html');
      }));
  
      it('uses the _source, field, and hit to create a <dl>', function () {
        let hit = _.first(hits);
        let $dl = $(convertHtml(hit._source, indexPattern.fields.byName._source, hit));
        expect($dl.is('dl')).to.be.ok();
        expect($dl.find('dt')).to.have.length(_.keys(indexPattern.flattenHit(hit)).length);
      });
    });
  });
  