Skip to content

Commit

Permalink
implemntation ( locales portlet ): #30395 Click on a locale in the ne…
Browse files Browse the repository at this point in the history
…w 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
  • Loading branch information
hmoreras authored Oct 18, 2024
1 parent b5e54e2 commit 2d60cb6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</tr>
</ng-template>
<ng-template pTemplate="body" let-locale>
<tr>
<tr (click)="store.openAddEditDialog(locale.id)" data-testId="locale-row">
<td [ngClass]="{ 'tag-padding': locale.defaultLanguage }" data-testId="locale-cell">
{{ locale.language }} ({{ locale.isoCode }})
@if (locale.defaultLanguage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

0 comments on commit 2d60cb6

Please sign in to comment.