Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Fix unit tests to use stored_fields instead of fields ES param.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Jun 24, 2016
1 parent 3eebb6c commit 0b02e38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('pattern review directive', function () {

describe('handling geopoints', function () {

it('should detect geo_point fields when they\'re expressed as an object', function () {
it('should detect geo_point stored_fields when they\'re expressed as an object', function () {
const scope = $rootScope.$new();
scope.sampleDoc = {
geoip: {
Expand All @@ -29,10 +29,10 @@ describe('pattern review directive', function () {
scope.$digest();

expect(scope).to.have.property('indexPattern');
expect(scope.indexPattern.fields[0].type).to.be('geo_point');
expect(scope.indexPattern.stored_fields[0].type).to.be('geo_point');
});

it('should not count the lat and lon properties as their own fields', function () {
it('should not count the lat and lon properties as their own stored_fields', function () {
const scope = $rootScope.$new();
scope.sampleDoc = {
geoip: {
Expand All @@ -47,14 +47,14 @@ describe('pattern review directive', function () {
scope.$digest();

expect(scope).to.have.property('indexPattern');
expect(scope.indexPattern.fields[0].type).to.be('geo_point');
expect(scope.indexPattern.fields.length).to.be(1);
expect(scope.indexPattern.stored_fields[0].type).to.be('geo_point');
expect(scope.indexPattern.stored_fields.length).to.be(1);
});
});

describe('detecting date fields', function () {
describe('detecting date stored_fields', function () {

it('should detect sample strings in ISO 8601 format as date fields', function () {
it('should detect sample strings in ISO 8601 format as date stored_fields', function () {
const scope = $rootScope.$new();
scope.sampleDoc = {
isodate: '2004-03-08T00:05:49.000Z'
Expand All @@ -64,7 +64,7 @@ describe('pattern review directive', function () {
scope.$digest();

expect(scope).to.have.property('indexPattern');
expect(scope.indexPattern.fields[0].type).to.be('date');
expect(scope.indexPattern.stored_fields[0].type).to.be('date');
});

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ describe('get computed fields', function () {
});

it('should request all stored fields', function () {
expect(fn().fields).to.contain('*');
expect(fn().storedFields).to.contain('*');
});

it('should request _source seperately', function () {
expect(fn().fields).to.contain('_source');
expect(fn().storedFields).to.contain('_source');
});

it('should request date fields as fielddata_fields', function () {
Expand Down

0 comments on commit 0b02e38

Please sign in to comment.