diff --git a/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.html b/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.html
index b36a8a7..d3d5d8c 100644
--- a/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.html
+++ b/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.html
@@ -83,6 +83,9 @@
Abrir modal ancho
Abrir simple modal
+
+ Abrir visor de imagen
+
{{ lastModalResult }}
diff --git a/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.spec.ts b/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.spec.ts
index ae141d8..25d24fb 100644
--- a/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.spec.ts
+++ b/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.spec.ts
@@ -51,6 +51,7 @@ function createModalServiceStub() {
open: vi.fn(),
openConfirm: vi.fn().mockReturnValue(of(true)),
openConfirmDelete: vi.fn().mockReturnValue(of(false)),
+ openImage: vi.fn().mockReturnValue(of(undefined)),
};
}
@@ -281,6 +282,9 @@ describe('ReutilizablesTestPageComponent', () => {
const deleteButton = buttons.find((button) =>
button.textContent?.includes('Abrir confirm delete'),
) as HTMLButtonElement;
+ const imageButton = buttons.find((button) =>
+ button.textContent?.includes('Abrir visor de imagen'),
+ ) as HTMLButtonElement;
expect(element.querySelector('[data-testid="modal-last-result"]')?.textContent).toContain(
'Todavia no se abrio ningun modal.',
@@ -290,6 +294,8 @@ describe('ReutilizablesTestPageComponent', () => {
fixture.detectChanges();
deleteButton.click();
fixture.detectChanges();
+ imageButton.click();
+ fixture.detectChanges();
expect(modalServiceStub.openConfirm).toHaveBeenCalledWith({
title: 'Confirmar accion',
@@ -302,6 +308,11 @@ describe('ReutilizablesTestPageComponent', () => {
'Esta accion eliminara el producto del catalogo. Podras volver a crearlo manualmente.',
confirmLabel: 'Eliminar',
});
+ expect(modalServiceStub.openImage).toHaveBeenCalledWith({
+ title: 'Mochila urbana roja',
+ src: '/images/carousel-mochila-roja.webp',
+ alt: 'Mochila urbana roja vista de frente',
+ });
expect(element.querySelector('[data-testid="modal-last-result"]')?.textContent).toContain(
'Resultado: false',
);
diff --git a/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.ts b/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.ts
index 1e5e77e..e7c3cac 100644
--- a/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.ts
+++ b/src/app/features/componentes-test/pages/reutilizables-test-page/reutilizables-test-page.component.ts
@@ -493,6 +493,14 @@ export class ReutilizablesTestPageComponent {
});
}
+ protected openImageModal(): void {
+ this.modalService.openImage({
+ title: 'Mochila urbana roja',
+ src: '/images/carousel-mochila-roja.webp',
+ alt: 'Mochila urbana roja vista de frente',
+ });
+ }
+
private openConfirmModal(config: Parameters[0]): void {
this.modalService.openConfirm(config).subscribe((confirmed) => {
this.lastModalResult = `Resultado: ${confirmed}`;