feat(hero-banner): add conditional class for media presence and adjust styles
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user