mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3200] Attach button of content node selector becomes enabled when selecting a folder (#5946)
* [AAE-3200] Attach button of content node selector becomes enabled when selecting a folder * * Removed excluded test from the protractor.exludes.json file
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
</button>
|
||||
|
||||
<button mat-button
|
||||
[disabled]="!chosenNode"
|
||||
[disabled]="!hasNodeSelected()"
|
||||
class="adf-choose-action"
|
||||
(click)="onClick()"
|
||||
data-automation-id="content-node-selector-actions-choose">{{ buttonActionName | translate }}
|
||||
|
@@ -161,6 +161,22 @@ describe('ContentNodeSelectorDialogComponent', () => {
|
||||
const actionButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]'));
|
||||
expect(actionButton.nativeElement.disabled).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should be disabled when no node chosen', () => {
|
||||
component.onSelect([new Node({ id: 'fake' })]);
|
||||
fixture.detectChanges();
|
||||
|
||||
const actionButtonWithNodeSelected = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]'));
|
||||
|
||||
expect(actionButtonWithNodeSelected.nativeElement.disabled).toBe(false);
|
||||
|
||||
component.onSelect([]);
|
||||
fixture.detectChanges();
|
||||
|
||||
const actionButtonWithoutNodeSelected = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]'));
|
||||
|
||||
expect(actionButtonWithoutNodeSelected.nativeElement.disabled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Title', () => {
|
||||
|
@@ -82,4 +82,8 @@ export class ContentNodeSelectorComponent {
|
||||
onError(error) {
|
||||
this.notificationService.showError(error);
|
||||
}
|
||||
|
||||
hasNodeSelected(): boolean {
|
||||
return this.chosenNode?.length > 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user