mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[serverless] add sorting to Discover CSV tests (#179901)
## Summary Add sorting via api calls. Update mappings file to load field data. Update snapshots
This commit is contained in:
parent
0eba4ae42c
commit
c1d310bbc6
3 changed files with 12 additions and 10 deletions
|
@ -6,7 +6,8 @@
|
|||
"dynamic": false,
|
||||
"properties": {
|
||||
"text": {
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"fielddata": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,21 +79,21 @@ xgMtOW0BH63Xcmy45GnD,ecommerce,\\"-\\",\\"Women's Clothing, Women's Shoes, Women
|
|||
|
||||
exports[`Reporting Generate CSV from SearchSource with unmapped fields includes all unmapped fields to the report 1`] = `
|
||||
"\\"_id\\",\\"_index\\",\\"_score\\",\\"nested.unmapped\\",text,unmapped
|
||||
1,recipes,1,\\"-\\",text1,unmapped1
|
||||
2,recipes,1,unmapped2,text2,\\"-\\"
|
||||
1,recipes,\\"-\\",\\"-\\",text1,unmapped1
|
||||
2,recipes,\\"-\\",unmapped2,text2,\\"-\\"
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`Reporting Generate CSV from SearchSource with unmapped fields includes an unmapped field to the report 1`] = `
|
||||
"\\"_id\\",\\"_index\\",\\"_score\\",text,unmapped
|
||||
1,recipes,1,text1,unmapped1
|
||||
2,recipes,1,text2,\\"-\\"
|
||||
1,recipes,\\"-\\",text1,unmapped1
|
||||
2,recipes,\\"-\\",text2,\\"-\\"
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`Reporting Generate CSV from SearchSource with unmapped fields includes an unmapped nested field to the report 1`] = `
|
||||
"\\"_id\\",\\"_index\\",\\"_score\\",\\"nested.unmapped\\",text
|
||||
1,recipes,1,\\"-\\",text1
|
||||
2,recipes,1,unmapped2,text2
|
||||
1,recipes,\\"-\\",\\"-\\",text1
|
||||
2,recipes,\\"-\\",unmapped2,text2
|
||||
"
|
||||
`;
|
||||
|
|
|
@ -184,6 +184,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
query: { language: 'kuery', query: '' },
|
||||
fields: fields.map((field) => ({ field, include_unmapped: 'true' })),
|
||||
filter: [],
|
||||
sort: [{ text: 'asc' as SortDirection }],
|
||||
},
|
||||
title: 'Untitled discover search',
|
||||
version: '8.14.0',
|
||||
|
@ -195,19 +196,19 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
|
||||
it('includes an unmapped field to the report', async () => {
|
||||
const csvFile = await generateCsvReportWithUnmapped(['text', 'unmapped']);
|
||||
expect((csvFile as string).length).to.be(88);
|
||||
expect((csvFile as string).length).to.be(92);
|
||||
expectSnapshot(createPartialCsv(csvFile)).toMatch();
|
||||
});
|
||||
|
||||
it('includes an unmapped nested field to the report', async () => {
|
||||
const csvFile = await generateCsvReportWithUnmapped(['text', 'nested.unmapped']);
|
||||
expect((csvFile as string).length).to.be(97);
|
||||
expect((csvFile as string).length).to.be(101);
|
||||
expectSnapshot(createPartialCsv(csvFile)).toMatch();
|
||||
});
|
||||
|
||||
it('includes all unmapped fields to the report', async () => {
|
||||
const csvFile = await generateCsvReportWithUnmapped(['*']);
|
||||
expect((csvFile as string).length).to.be(120);
|
||||
expect((csvFile as string).length).to.be(124);
|
||||
expectSnapshot(createPartialCsv(csvFile)).toMatch();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue