All files / src/Simulate Modules.ts

25% Statements 3/12
0% Branches 0/2
0% Functions 0/7
25% Lines 3/12
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 28 29 30 31 32 33 34 35 36 372x   2x                                     2x                              
import { ModalBox, $$, IQuery } from "coveo-search-ui";
 
export function modalBoxModule(): ModalBox.ModalBox {
  const modalBox = <any>{};
  modalBox.open = jasmine.createSpy("open");
  modalBox.close = jasmine.createSpy("close");
  modalBox.open.and.returnValue({
    modalBox: $$("div", undefined, $$("div", { className: "coveo-wrapper" }))
      .el,
    wrapper: $$(
      "div",
      undefined,
      $$("div", { className: "coveo-quickview-close-button" })
    ).el,
    overlay: $$("div").el,
    content: $$("div").el,
    close: modalBox.close
  });
  return modalBox;
}
 
export function analyticsStoreModule(
  actionsHistory: CoveoAnalytics.HistoryElement[] = []
): CoveoAnalytics.HistoryStore {
  return {
    addElement: (query: IQuery) => {},
    getHistory: () => {
      return actionsHistory;
    },
    setHistory: (history: any[]) => {},
    clear: () => {},
    getMostRecentElement: () => {
      return null;
    }
  };
}