// import { Http } from "../../commons/utils/http"; // import { EventType } from "../../event/core/event"; // import { HipervarejoRunner } from "./hipervarejo-runner"; // const hiperRunner = new HipervarejoRunner(); // beforeEach(() => { // const post = jest.fn().mockReturnValue({ status: 204 }); // post.mockClear(); // (Http as any).post = post; // }); // test("running the hipervarejo runner when price is over 999 shoudld result in number price", async () => { // window.dataLayer = [ // { // pageType: "PURCHASE", // transactionID: "orderId", // transactionProducts: [ // { // id: "productId", // quantity: 1, // price: "2,999.99", // }, // ], // }, // ]; // hiperRunner.start(); // // Wait for all events to be processed. // await new Promise((resolve) => setTimeout(resolve, 1000)); // expect(Http.post).toHaveBeenCalledTimes(2); // expect(Http.post).toHaveBeenNthCalledWith( // 1, // expect.any(String), // expect.objectContaining({ type: EventType.SessionPing }), // ); // expect(Http.post).toHaveBeenNthCalledWith( // 2, // expect.any(String), // expect.objectContaining({ // type: EventType.PageConfirmation, // products: expect.arrayContaining([ // expect.objectContaining({ // price: 2999.99, // }), // ]), // }), // ); // });