feat: enhance cart functionality with quantity update and removal features, integrating toast notifications for user feedback
This commit is contained in:
@@ -7,6 +7,7 @@ import { of } from 'rxjs';
|
||||
import { Tenant } from '../../services/tenant.interface';
|
||||
import { TenantService } from '../../services/tenant.service';
|
||||
import { CartService } from '../../services/cart/cart.service';
|
||||
import { ToastService } from '../../services/toast.service';
|
||||
import { StoreLayoutComponent } from './store-layout.component';
|
||||
|
||||
const tenant: Tenant = {
|
||||
@@ -45,7 +46,19 @@ describe('StoreLayoutComponent', () => {
|
||||
provide: CartService,
|
||||
useValue: {
|
||||
cart: signal(null).asReadonly(),
|
||||
loadCart: () => of({ id: 1, items: [], subtotal: '0' })
|
||||
loadCart: () => of({ id: 1, items: [], subtotal: '0' }),
|
||||
updateItemQuantity: vi.fn().mockReturnValue(of({ data: { id: 1, items: [], subtotal: '0' } })),
|
||||
removeItem: vi.fn().mockReturnValue(of({ data: { id: 1, items: [], subtotal: '0' } }))
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: ToastService,
|
||||
useValue: {
|
||||
show: vi.fn(),
|
||||
info: vi.fn(),
|
||||
danger: vi.fn(),
|
||||
success: vi.fn(),
|
||||
dismiss: vi.fn()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user