/** * Testkit for testing dealer BI events. * * Provides a singleton-style API similar to biTestkit from @wix/bex-core/bi/testkit. * Captures dealer reportEvent HTTP calls and provides utilities to assert on events. * * @example * ```typescript * import dealerBITestkit from '../test-utils/DealerBIMock'; * * describe('MyComponent', () => { * const setup = () => { * const driver = new MyDriver({ * httpMocks: [ * // ... other mocks * dealerBITestkit.httpMock, * ], * }); * return { driver }; * }; * * it('sends view event', async () => { * setup(); * // ... trigger the view event * * expect(dealerBITestkit.view.last()).toEqual( * expect.objectContaining({ * offerId: 'offer-1', * }), * ); * }); * }); * ``` */ import type { AnyScenario } from '@wix/http-client-testkit'; export { EventType } from '@wix/bex-utils/@wix/ambassador-dealer-v1-offer-event/types'; interface ReportEventData { event?: { type?: string; offerId?: string; realEstateId?: string; [key: string]: unknown; }; [key: string]: unknown; } interface EventTypeAccessor { /** Get all events of this type */ all: () => ReportEventData[]; /** Get the last event of this type */ last: () => ReportEventData | undefined; /** Get event count of this type */ count: () => number; } interface DealerBITestkit { /** The HTTP mock - add this to your driver's httpMocks array */ httpMock: AnyScenario; /** Access VIEW events */ view: EventTypeAccessor; /** Access MAIN_CTA_CLICK events */ mainCtaClick: EventTypeAccessor; /** Get all captured events (any type) */ all: () => ReportEventData[]; /** Get the last captured event (any type) */ last: () => ReportEventData | undefined; /** Clear all captured events - call in beforeEach for test isolation */ clear: () => void; } declare const dealerBITestkit: DealerBITestkit; export default dealerBITestkit; export { dealerBITestkit }; //# sourceMappingURL=DealerBIMock.d.ts.map