feat: add event_date_text to Tenant interface and update StoreHomePageComponent to display formatted event dates

This commit is contained in:
2026-08-10 10:42:15 -03:00
parent 7c2a098696
commit dd828d9a4e
3 changed files with 4 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ export interface Tenant {
footer_logo: string;
website_type_code?: string | null;
website_type?: WebsiteType | null;
event_date_text?: string | null;
extras?: WebsiteExtras;
event?: TenantEvent | null;
selected_bank_account_id?: number | null;

View File

@@ -213,6 +213,7 @@ describe('StoreHomePageComponent', () => {
},
],
};
tenant.event_date_text = '5 y 6 de Diciembre 2026';
tenant.website_type_code = 'onticket';
tenant.social_media = [
{
@@ -259,7 +260,7 @@ describe('StoreHomePageComponent', () => {
expect(hero.textContent).toContain('Fiesta Fútbol Infantil');
expect(hero.textContent).toContain('Viví una jornada inolvidable de fútbol infantil.');
expect(hero.textContent).toContain('Rosario, Santa Fe');
expect(hero.textContent).toContain('2026-12-05, 2026-12-06');
expect(hero.textContent).toContain('5 y 6 de Diciembre 2026');
const heroComponent = fixture.debugElement.query(By.directive(HeroBannerComponent))
.componentInstance as HeroBannerComponent;
expect(heroComponent.eventConfig?.contact).toEqual(tenant.social_media);

View File

@@ -75,6 +75,7 @@ export class StoreHomePageComponent implements OnInit, OnDestroy {
id: tenant.id,
title: event.title,
location: event.location,
dates_text: tenant.event_date_text,
dates: event.dates.map((eventDate) => ({
id: eventDate.id,
date: eventDate.date,