refactor(event): replace bootstrap notices with claimed notices

This commit is contained in:
2026-09-16 08:19:28 -03:00
parent f87f7f55a9
commit 4923010afb
5 changed files with 41 additions and 144 deletions

View File

@@ -6,7 +6,6 @@ import { provideRouter } from '@angular/router';
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
import { App } from './app';
import { EventDateNoticeService } from './core/services/event-date-notice.service';
import { Tenant } from './core/services/tenant.interface';
import { TenantService } from './core/services/tenant.service';
@@ -117,48 +116,4 @@ describe('App', () => {
).toBe("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E");
});
it('shows the date notices returned by the tenant bootstrap once', async () => {
const show = vi.fn();
const dateNotices = [
{
type: 'suspended' as const,
title: 'FECHA CANCELADA!',
message: [
{ text: 'La fecha del ', bold: false },
{ text: '09 de Octubre de 2026', bold: true },
{ text: ' ha sido cancelada.', bold: false },
],
},
];
await TestBed.configureTestingModule({
imports: [App],
providers: [
provideRouter([]),
{
provide: TenantService,
useValue: createTenantServiceStub('ready', {
...tenant,
event: {
title: 'Festival',
location: 'Predio',
dates: [],
date_notices: dateNotices,
},
}),
},
{
provide: EventDateNoticeService,
useValue: { show },
},
],
}).compileComponents();
const fixture = TestBed.createComponent(App);
fixture.detectChanges();
fixture.detectChanges();
expect(show).toHaveBeenCalledOnce();
expect(show).toHaveBeenCalledWith(dateNotices);
});
});