diff --git a/src/app/features/store/pages/checkout-page/checkout-page.component.spec.ts b/src/app/features/store/pages/checkout-page/checkout-page.component.spec.ts index 11218aa..aed8a07 100644 --- a/src/app/features/store/pages/checkout-page/checkout-page.component.spec.ts +++ b/src/app/features/store/pages/checkout-page/checkout-page.component.spec.ts @@ -537,7 +537,7 @@ describe('CheckoutPageComponent payment validation', () => { expect(component.isEditingItems()).toBe(false); }); - it('shows Modificar and returns to the home cart when checkout editing is disabled', async () => { + it('shows Modificar, restores the previous cart and opens it when checkout editing is disabled', async () => { tenantState.set({ codigo: 'tenant-test', checkout_editing_policy: { @@ -586,6 +586,10 @@ describe('CheckoutPageComponent payment validation', () => { expect(component.canModifyCart()).toBe(false); expect(component.isEditingItems()).toBe(false); expect(checkoutServiceStub.prepareItemEditing).not.toHaveBeenCalled(); + expect(checkoutServiceStub.cancelPurchase).toHaveBeenCalledWith('tenant-test', 25); + expect(cartServiceStub.loadCart).toHaveBeenCalled(); + expect(component.createdPurchaseId()).toBeNull(); + expect(component.createdPurchase()).toBeNull(); expect(routerStub.navigate).toHaveBeenCalledWith(['/'], { queryParams: { openCart: true }, });