From 2d60cb6df33b374979837af0622b70bcaa6d7b93 Mon Sep 17 00:00:00 2001 From: Humberto Morera <31667212+hmoreras@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:11:50 -0600 Subject: [PATCH] implemntation ( locales portlet ): #30395 Click on a locale in the new Locales portlet doesn't to anything (#30402) ### Proposed Changes * Add click event on row to show the edit popup. ### Screenshots https://github.com/user-attachments/assets/2ef16df8-7fa6-47e8-a04b-139d83567a58 --- .../dot-locales-list/dot-locales-list.component.html | 2 +- .../dot-locales-list.component.spec.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.html b/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.html index 0414d374d3de..837bc51dbead 100644 --- a/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.html +++ b/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.html @@ -44,7 +44,7 @@ - + {{ locale.language }} ({{ locale.isoCode }}) @if (locale.defaultLanguage) { diff --git a/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.spec.ts b/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.spec.ts index 130a8b2e77b5..9363423c12c8 100644 --- a/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.spec.ts +++ b/core-web/libs/portlets/dot-locales/portlet/src/lib/dot-locales-list/dot-locales-list.component.spec.ts @@ -81,4 +81,16 @@ describe('DotLocalesListComponent', () => { expect(spectator.query('.p-tag-success')).toHaveText('Default'); }); + + it('should open AddEditDialog with locale id when row is clicked', () => { + spectator.detectChanges(); + + jest.spyOn(spectator.component.store, 'openAddEditDialog'); + + const row = spectator.query(byTestId('locale-row')); + + spectator.click(row); + + expect(spectator.component.store.openAddEditDialog).toHaveBeenCalled(); + }); });