UNPKG

@eagleeye-solutions/integration-events-common

Version:
49 lines 1.98 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const src_1 = require("../../../src"); const fixtures_1 = require("../../fixtures"); describe('getWalletAccountUpdateEventData', () => { it('returns Coupon Redeemed events and an Order Completed event', () => { // Arrange const event = src_1.EeAirOutboundEventSchema.parse(fixtures_1.sampleEvents.WALLET_ACCOUNT_UPDATE); const expectedOutput = { account: { accountId: '4083796503', campaignId: '100767004', type: 'STANDARD_SUBSCRIPTION', clientType: null, state: 'LOADED', status: 'CANCELLED', dateStart: new Date('2025-01-22T21:36:54.000Z'), dateEnd: new Date('2038-01-19T03:14:07.000Z'), }, entitlements: [ { accountId: '4083796504', campaignId: '100767002', type: 'ECOUPON', clientType: 'ENTITLEMENT', state: 'LOADED', status: 'CANCELLED', dateStart: new Date('2025-01-22T21:36:54.000Z'), dateEnd: new Date('2026-12-31T23:59:00.000Z'), }, { accountId: '4083796505', campaignId: '100767003', type: 'ECOUPON', clientType: 'ENTITLEMENT', state: 'LOADED', status: 'CANCELLED', dateStart: new Date('2025-01-22T21:36:54.000Z'), dateEnd: new Date('2026-12-31T23:59:00.000Z'), }, ], }; // Act const output = (0, src_1.getWalletAccountUpdateEventData)(event); // Assert expect(output).toEqual(expectedOutput); }); }); //# sourceMappingURL=wallet-account-update.spec.js.map