feat(cart): implement cart editing policy with granular permissions
This commit is contained in:
@@ -340,7 +340,7 @@ describe('CartComponent', () => {
|
||||
quantity: 1,
|
||||
},
|
||||
]);
|
||||
fixture.componentRef.setInput('allowEditing', true);
|
||||
fixture.componentRef.setInput('requireEditingMode', true);
|
||||
const editingChange = vi.fn();
|
||||
fixture.componentInstance.editing.subscribe(editingChange);
|
||||
fixture.detectChanges();
|
||||
@@ -408,7 +408,7 @@ describe('CartComponent', () => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('hides the edit toggle and disables quantity changes when editable is false', async () => {
|
||||
it('hides the edit toggle and disables quantity changes when quantity updates are false', async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CartComponent],
|
||||
providers: [
|
||||
@@ -441,8 +441,9 @@ describe('CartComponent', () => {
|
||||
quantity: 1,
|
||||
},
|
||||
]);
|
||||
fixture.componentRef.setInput('allowEditing', true);
|
||||
fixture.componentRef.setInput('editable', false);
|
||||
fixture.componentRef.setInput('requireEditingMode', true);
|
||||
fixture.componentRef.setInput('allowModify', false);
|
||||
fixture.componentRef.setInput('allowUpdateQuantity', false);
|
||||
const quantityChange = vi.fn();
|
||||
fixture.componentInstance.itemQuantityChange.subscribe(quantityChange);
|
||||
fixture.detectChanges();
|
||||
|
||||
Reference in New Issue
Block a user