diff --git a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js index 0dd1b04ad8200..036e0f88fd0cd 100644 --- a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js +++ b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js @@ -29,26 +29,26 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('document example'); const response = await getResponse(); const firstHit = response.hits.hits[0]; - expect(Object.keys(firstHit).join(',')).to.equal('_index,_type,_id,_score,fields'); - expect(Object.keys(firstHit.fields).join(',')).to.equal('geo.coordinates'); + expect(firstHit).to.only.have.keys(['_id', '_index', '_type', '_score', 'fields']); + expect(firstHit.fields).to.only.have.keys(['geo.coordinates']); }); it('should only fetch geo_point field and data driven styling fields', async () => { await PageObjects.maps.loadSavedMap('document example with data driven styles'); const response = await getResponse(); const firstHit = response.hits.hits[0]; - expect(Object.keys(firstHit).join(',')).to.equal('_index,_type,_id,_score,fields'); - expect(Object.keys(firstHit.fields).join(',')).to.equal('geo.coordinates,bytes,hour_of_day'); + expect(firstHit).to.only.have.keys(['_id', '_index', '_type', '_score', 'fields']); + expect(firstHit.fields).to.only.have.keys(['bytes', 'geo.coordinates', 'hour_of_day']); }); it('should format date fields as epoch_millis when data driven styling is applied to a date field', async () => { await PageObjects.maps.loadSavedMap('document example with data driven styles on date field'); const response = await getResponse(); const firstHit = response.hits.hits[0]; - expect(Object.keys(firstHit).join(',')).to.equal('_index,_type,_id,_score,fields'); - expect(Object.keys(firstHit.fields).join(',')).to.equal('geo.coordinates,bytes,@timestamp'); + expect(firstHit).to.only.have.keys(['_id', '_index', '_type', '_score', 'fields']); + expect(firstHit.fields).to.only.have.keys(['@timestamp', 'bytes', 'geo.coordinates']); expect(firstHit.fields['@timestamp']).to.be.an('array'); - expect(firstHit.fields['@timestamp'][0]).to.equal('1442709321445'); + expect(firstHit.fields['@timestamp'][0]).to.eql('1442709321445'); }); }); }