feat: update WebsiteType and EventConfig interfaces with new properties, enhance tenant creation in tests

This commit is contained in:
2026-08-03 09:09:58 -03:00
parent 941cb5c73c
commit ec18aaf0c5
3 changed files with 38 additions and 5 deletions

View File

@@ -12,6 +12,11 @@ export interface BankAccount {
export interface WebsiteType {
codigo: string;
nombre: string;
primary_color: string | null;
secondary_color: string | null;
danger_color: string | null;
success_color: string | null;
site_logo: string | null;
}
export interface HeroConfig {
@@ -22,11 +27,17 @@ export interface HeroConfig {
button_href?: string | null;
}
export interface EventDate {
date: string;
start_time: string;
end_time: string;
}
export interface EventConfig {
title?: string | null;
location?: string | null;
dates_text?: string | null;
dates?: string[] | null;
dates?: EventDate[] | null;
}
export interface WebsiteExtras {

View File

@@ -103,7 +103,15 @@ function createTenant(extras: Tenant['extras'] = {}): Tenant {
header_logo: '/header.png',
footer_logo: '/footer.png',
website_type_code: 'shopit',
website_type: { codigo: 'shopit', nombre: 'ShopIt' },
website_type: {
codigo: 'shopit',
nombre: 'ShopIt',
primary_color: null,
secondary_color: null,
danger_color: null,
success_color: null,
site_logo: null,
},
extras,
categories: [],
};
@@ -188,11 +196,25 @@ describe('StoreHomePageComponent', () => {
title: 'Fiesta Fútbol Infantil',
location: 'Rosario, Santa Fe',
dates_text: '5 y 6 de diciembre de 2026',
dates: ['2026-12-05'],
dates: [
{
date: '2026-12-05',
start_time: '09:00',
end_time: '18:00',
},
],
},
});
tenant.website_type_code = 'onticket';
tenant.website_type = { codigo: 'onticket', nombre: 'OnTicket' };
tenant.website_type = {
codigo: 'onticket',
nombre: 'OnTicket',
primary_color: null,
secondary_color: null,
danger_color: null,
success_color: null,
site_logo: null,
};
await TestBed.configureTestingModule({
imports: [StoreHomePageComponent],

View File

@@ -25,6 +25,6 @@ export class HeroBannerComponent {
return '';
}
return this.eventConfig.dates.join(', ');
return this.eventConfig.dates.map(({ date }) => date).join(', ');
}
}