feat: update WebsiteType and EventConfig interfaces with new properties, enhance tenant creation in tests
This commit is contained in:
@@ -12,6 +12,11 @@ export interface BankAccount {
|
|||||||
export interface WebsiteType {
|
export interface WebsiteType {
|
||||||
codigo: string;
|
codigo: string;
|
||||||
nombre: 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 {
|
export interface HeroConfig {
|
||||||
@@ -22,11 +27,17 @@ export interface HeroConfig {
|
|||||||
button_href?: string | null;
|
button_href?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface EventDate {
|
||||||
|
date: string;
|
||||||
|
start_time: string;
|
||||||
|
end_time: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface EventConfig {
|
export interface EventConfig {
|
||||||
title?: string | null;
|
title?: string | null;
|
||||||
location?: string | null;
|
location?: string | null;
|
||||||
dates_text?: string | null;
|
dates_text?: string | null;
|
||||||
dates?: string[] | null;
|
dates?: EventDate[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WebsiteExtras {
|
export interface WebsiteExtras {
|
||||||
|
|||||||
@@ -103,7 +103,15 @@ function createTenant(extras: Tenant['extras'] = {}): Tenant {
|
|||||||
header_logo: '/header.png',
|
header_logo: '/header.png',
|
||||||
footer_logo: '/footer.png',
|
footer_logo: '/footer.png',
|
||||||
website_type_code: 'shopit',
|
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,
|
extras,
|
||||||
categories: [],
|
categories: [],
|
||||||
};
|
};
|
||||||
@@ -188,11 +196,25 @@ describe('StoreHomePageComponent', () => {
|
|||||||
title: 'Fiesta Fútbol Infantil',
|
title: 'Fiesta Fútbol Infantil',
|
||||||
location: 'Rosario, Santa Fe',
|
location: 'Rosario, Santa Fe',
|
||||||
dates_text: '5 y 6 de diciembre de 2026',
|
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_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({
|
await TestBed.configureTestingModule({
|
||||||
imports: [StoreHomePageComponent],
|
imports: [StoreHomePageComponent],
|
||||||
|
|||||||
@@ -25,6 +25,6 @@ export class HeroBannerComponent {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.eventConfig.dates.join(', ');
|
return this.eventConfig.dates.map(({ date }) => date).join(', ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user