本文整理汇总了TypeScript中ui/index_patterns/fixtures.mockFields类的典型用法代码示例。如果您正苦于以下问题:TypeScript mockFields类的具体用法?TypeScript mockFields怎么用?TypeScript mockFields使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了mockFields类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should return an empty array if the field is not aggregatable', async () => {
const index = mockIndexPattern.id;
const [field] = mockFields.filter(({ aggregatable }) => !aggregatable);
const query = '';
const suggestions = await getSuggestions(index, field, query);
expect(suggestions).toEqual([]);
expect(fetch).not.toHaveBeenCalled();
});
示例2: it
it('does not return range for string fields', () => {
const [field] = mockFields.filter(({ type }) => type === 'string');
const operatorOptions = getOperatorOptions(field);
const rangeOperator = operatorOptions.find(operator => operator.type === 'range');
expect(rangeOperator).toBeUndefined();
});