mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4406] - Confirm Dialog doesn't support a third extra button option to be customised (#4608)
* [ADF-4406] - Confirm Dialog doesn't support a third extra button option to be customised * * comments fixed * * docs and test added
This commit is contained in:
@@ -26,6 +26,7 @@ import { By } from '@angular/platform-browser';
|
||||
describe('Confirm Dialog Component', () => {
|
||||
let fixture: ComponentFixture<ConfirmDialogComponent>;
|
||||
let component: ConfirmDialogComponent;
|
||||
|
||||
const dialogRef = {
|
||||
close: jasmine.createSpy('close')
|
||||
};
|
||||
@@ -140,4 +141,27 @@ describe('Confirm Dialog Component', () => {
|
||||
expect(messageElement.nativeElement.innerText).toBe('MAYBE NO');
|
||||
});
|
||||
});
|
||||
|
||||
describe('thirdOptionLabel is given', () => {
|
||||
|
||||
it('should NOT render the thirdOption if is thirdOptionLabel is not passed', () => {
|
||||
component.thirdOptionLabel = undefined;
|
||||
fixture.detectChanges();
|
||||
const thirdOptionElement = fixture.debugElement.query(
|
||||
By.css('[data-automation-id="adf-confirm-dialog-confirm-all"]')
|
||||
);
|
||||
expect(thirdOptionElement).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should render the thirdOption if thirdOptionLabel is passed', () => {
|
||||
component.thirdOptionLabel = 'Yes All';
|
||||
fixture.detectChanges();
|
||||
const thirdOptionElement = fixture.debugElement.query(
|
||||
By.css('[data-automation-id="adf-confirm-dialog-confirm-all"]')
|
||||
);
|
||||
expect(thirdOptionElement).not.toBeNull();
|
||||
expect(thirdOptionElement.nativeElement.innerText).toBe('YES ALL');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user