All files / src/Fake FakeEventArgs.ts

100% Statements 3/3
100% Branches 2/2
14.29% Functions 1/7
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  3x     7x   4x                                        
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: rows,
    clear: () => {},
    clearCurrentExpression: () => {},
    closeOmnibox: () => {},
    insertAt: () => {},
    replace: () => {},
    replaceCurrentExpression: () => {}
  };
}