[ES|QL] improve test case generator script (#190441)

## Summary

Fixes a bug I introduced in
https://github.com/elastic/kibana/pull/189941

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Drew Tate 2024-08-15 08:07:16 -06:00 committed by GitHub
parent da1db2cdeb
commit bb2cc70a3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 234 additions and 2 deletions

View file

@ -21,8 +21,8 @@ import {
SupportedDataType,
FunctionDefinition,
dataTypes,
isSupportedDataType,
fieldTypes,
isFieldType,
} from '../src/definitions/types';
import { FUNCTION_DESCRIBE_BLOCK_NAME } from '../src/validation/function_describe_block_name';
import { getMaxMinNumberOfParams } from '../src/validation/helpers';
@ -1110,7 +1110,7 @@ function getFieldMapping(
return params.map(({ name: _name, type, constantOnly, literalOptions, ...rest }) => {
const typeString: string = type as string;
if (isSupportedDataType(typeString)) {
if (isFieldType(typeString)) {
if (useLiterals && literalOptions) {
return {
name: `"${literalOptions[0]}"`,