feat(hero-banner): add conditional class for media presence and adjust styles

This commit is contained in:
2026-09-03 13:39:23 -03:00
parent 4bd74d95cb
commit 9a6ec3d1f2
3 changed files with 40 additions and 12 deletions

View File

@@ -22,6 +22,21 @@ describe('HeroBannerComponent', () => {
expect(element.querySelector('img')?.getAttribute('src')).toBe(
'https://example.com/desktop.jpg',
);
expect(element.querySelector('.hero-banner')?.classList).toContain(
'hero-banner--with-media',
);
});
it('keeps the fallback banner sizing when there is no image', async () => {
await TestBed.configureTestingModule({ imports: [HeroBannerComponent] }).compileComponents();
const fixture = TestBed.createComponent(HeroBannerComponent);
fixture.componentRef.setInput('heroConfig', { title_html: 'Banner sin imagen' });
fixture.detectChanges();
const banner = (fixture.nativeElement as HTMLElement).querySelector('.hero-banner');
expect(banner?.classList).not.toContain('hero-banner--with-media');
});
it('expands and collapses the event schedules', async () => {