feat(hero-banner): update image handling to support responsive images and refactor template

feat(cart): enhance editing logic and add tests for editable state
feat(tenant): modify HeroConfig to include responsive image type
This commit is contained in:
2026-08-18 14:18:20 -03:00
parent 92ad7340fe
commit 9ba2041f7b
9 changed files with 115 additions and 14 deletions

View File

@@ -2,6 +2,28 @@ import { TestBed } from '@angular/core/testing';
import { HeroBannerComponent } from './hero-banner.component';
describe('HeroBannerComponent', () => {
it('renders desktop and mobile crop variants', async () => {
await TestBed.configureTestingModule({ imports: [HeroBannerComponent] }).compileComponents();
const fixture = TestBed.createComponent(HeroBannerComponent);
fixture.componentRef.setInput('heroConfig', {
background_image_id: {
desktop: 'https://example.com/desktop.jpg',
mobile: 'https://example.com/mobile.jpg',
},
});
fixture.detectChanges();
const element = fixture.nativeElement as HTMLElement;
expect(element.querySelector('source')?.getAttribute('srcset')).toBe(
'https://example.com/mobile.jpg',
);
expect(element.querySelector('img')?.getAttribute('src')).toBe(
'https://example.com/desktop.jpg',
);
});
it('expands and collapses the event schedules', async () => {
await TestBed.configureTestingModule({ imports: [HeroBannerComponent] }).compileComponents();