|
|
|
@ -60,6 +60,29 @@ describe('ConfirmationService', () => { |
|
|
|
expect(selectConfirmationContent('.custom-yes')).toBe('YES'); |
|
|
|
})); |
|
|
|
|
|
|
|
test('should display custom FA icon', fakeAsync(() => { |
|
|
|
service.show('MESSAGE', 'TITLE',undefined,{ |
|
|
|
icon:'fa fa-info' |
|
|
|
}); |
|
|
|
|
|
|
|
tick(); |
|
|
|
expect(selectConfirmationElement(".icon").className).toBe('icon fa fa-info') |
|
|
|
})); |
|
|
|
|
|
|
|
test('should display custom icon as html element', fakeAsync(() => { |
|
|
|
const className = 'custom-icon' |
|
|
|
const selector = '.'+className; |
|
|
|
|
|
|
|
service.show('MESSAGE', 'TITLE',undefined,{ |
|
|
|
iconTemplate: `<span class="${className}">I am icon</span>` |
|
|
|
}); |
|
|
|
|
|
|
|
tick(); |
|
|
|
|
|
|
|
const element = selectConfirmationElement(selector) |
|
|
|
expect(element).toBeTruthy() |
|
|
|
expect(element.innerHTML).toBe("I am icon") |
|
|
|
})); |
|
|
|
test.each` |
|
|
|
type | selector | icon |
|
|
|
${'info'} | ${'.info'} | ${'.fa-info-circle'} |
|
|
|
|