-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover][Main] Fix missing error message when building search query…
… throws exceptions (#103923) * Fix missing error message when building search fails * Fix test * Update _date_nested.ts * Lint config.js Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
b2a6a9d
commit 1fe4135
Showing
6 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const testSubjects = getService('testSubjects'); | ||
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); | ||
const security = getService('security'); | ||
|
||
describe('timefield is a date in a nested field', function () { | ||
before(async function () { | ||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nested'); | ||
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nested']); | ||
await PageObjects.common.navigateToApp('discover'); | ||
}); | ||
|
||
after(async function unloadMakelogs() { | ||
await security.testUser.restoreDefaults(); | ||
await esArchiver.unload('test/functional/fixtures/es_archiver/date_nested'); | ||
}); | ||
|
||
it('should show an error message', async function () { | ||
await PageObjects.discover.selectIndexPattern('date-nested'); | ||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
await testSubjects.existOrFail('discoverNoResultsError'); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
test/functional/fixtures/es_archiver/date_nested/data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"type": "doc", | ||
"value": { | ||
"id": "index-pattern:date-nested", | ||
"index": ".kibana", | ||
"source": { | ||
"index-pattern": { | ||
"fields":"[]", | ||
"timeFieldName": "@timestamp", | ||
"title": "date-nested" | ||
}, | ||
"type": "index-pattern" | ||
} | ||
} | ||
} | ||
|
||
|
||
{ | ||
"type": "doc", | ||
"value": { | ||
"id": "date-nested-1", | ||
"index": "date-nested", | ||
"source": { | ||
"message" : "test", | ||
"nested": { | ||
"timestamp": "2021-06-30T12:00:00.123Z" | ||
} | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
test/functional/fixtures/es_archiver/date_nested/mappings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"type": "index", | ||
"value": { | ||
"index": "date-nested", | ||
"mappings": { | ||
"properties": { | ||
"message": { | ||
"type": "text" | ||
}, | ||
"nested": { | ||
"type": "nested" | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"index": { | ||
"number_of_replicas": "0", | ||
"number_of_shards": "1" | ||
} | ||
} | ||
} | ||
} |