Skip to content

Commit

Permalink
ACS-8036 fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
g-jaskowski authored and DaryaBalvanovich committed Aug 12, 2024
1 parent 73597d9 commit 59d44c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
panelClass="aca-bulk-actions-select"
disableOptionCentering
data-automation-id="aca-bulk-actions-dropdown"
(keydown)="onKeyDown($event)"
>
<mat-select-trigger>
<adf-icon
Expand All @@ -27,7 +28,7 @@
[value]="option"
[title]="option.tooltip | translate"
[attr.data-automation-id]="option.id"
(onSelectionChange)="runAction({event: $event, actionOption: option})"
(click)="runAction(option)"
>
<adf-icon
*ngIf="option.icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,31 @@ describe('BulkActionsDropdownComponent', () => {
await selectOptionFromDropdown(0);
fixture.detectChanges();

expect(component.bulkSelectControl.value).toEqual(mockItem.id);
expect(component.bulkSelectControl.value).toEqual(mockItem);

extensionService.bulkActionExecuted();
fixture.detectChanges();

expect(component.bulkSelectControl.value).toBeNull();
});

it('should run dropdown action on Enter', () => {
spyOn(component, 'runAction');
component.bulkSelectControl.setValue(mockItem);
const selectElement = getElement('aca-bulk-actions-dropdown');
selectElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));

expect(component.runAction).toHaveBeenCalledWith(mockItem);
});

it('should NOT run dropdown action on Tab', () => {
spyOn(component, 'runAction');
component.bulkSelectControl.setValue(mockItem);
const selectElement = getElement('aca-bulk-actions-dropdown');
selectElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' }));

expect(component.runAction).not.toHaveBeenCalled();
});
});
});
});

0 comments on commit 59d44c1

Please sign in to comment.