coveo-search-ui-tests
Version:
Testing framework for the Coveo JavaScript Search Framework
27 lines (26 loc) • 771 B
text/typescript
import { IOmniboxDataRow, IPopulateOmniboxEventArgs } from "coveo-search-ui";
export function createPopulateOmniboxEventArgs(
queryboxContent: string,
cursorPosition: number,
rows: IOmniboxDataRow[] = []
): IPopulateOmniboxEventArgs {
return {
completeQueryExpression: {
word: queryboxContent,
regex: new RegExp(queryboxContent, "gi")
},
allQueryExpressions: undefined,
currentQueryExpression: {
word: queryboxContent,
regex: new RegExp(queryboxContent, "gi")
},
cursorPosition: cursorPosition,
rows: [],
clear: () => {},
clearCurrentExpression: () => {},
closeOmnibox: () => {},
insertAt: () => {},
replace: () => {},
replaceCurrentExpression: () => {}
};
}