fix(checkout): disable cart access

This commit is contained in:
2026-08-21 15:50:12 -03:00
parent c24a8b946d
commit 195ac73aed
9 changed files with 111 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ import { CartIconComponent } from './cart-icon.component';
describe('CartIconComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [CartIconComponent]
imports: [CartIconComponent],
}).compileComponents();
});
@@ -20,7 +20,7 @@ describe('CartIconComponent', () => {
return {
fixture,
element: fixture.nativeElement as HTMLElement
element: fixture.nativeElement as HTMLElement,
};
}
@@ -47,9 +47,11 @@ describe('CartIconComponent', () => {
});
it('disables the button when disabled is true', () => {
const { element } = setup(undefined, true);
const { element } = setup(3, true);
const button = element.querySelector('button');
expect(button?.disabled).toBe(true);
expect(button?.classList).toContain('cart-icon--disabled');
expect(element.querySelector('[data-testid="cart-badge"]')).toBeNull();
});
it('enables the button when disabled is false', () => {