test(checkout): cover cart restoration before editing
This commit is contained in:
@@ -537,7 +537,7 @@ describe('CheckoutPageComponent payment validation', () => {
|
|||||||
expect(component.isEditingItems()).toBe(false);
|
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({
|
tenantState.set({
|
||||||
codigo: 'tenant-test',
|
codigo: 'tenant-test',
|
||||||
checkout_editing_policy: {
|
checkout_editing_policy: {
|
||||||
@@ -586,6 +586,10 @@ describe('CheckoutPageComponent payment validation', () => {
|
|||||||
expect(component.canModifyCart()).toBe(false);
|
expect(component.canModifyCart()).toBe(false);
|
||||||
expect(component.isEditingItems()).toBe(false);
|
expect(component.isEditingItems()).toBe(false);
|
||||||
expect(checkoutServiceStub.prepareItemEditing).not.toHaveBeenCalled();
|
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(['/'], {
|
expect(routerStub.navigate).toHaveBeenCalledWith(['/'], {
|
||||||
queryParams: { openCart: true },
|
queryParams: { openCart: true },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user