mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix eslint warnigs for core project (#7506)
This commit is contained in:
@@ -101,14 +101,14 @@ describe('CopyClipboardDirective', () => {
|
||||
});
|
||||
|
||||
it('should show tooltip when hover element', (() => {
|
||||
const spanHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('span');
|
||||
const spanHTMLElement = element.querySelector<HTMLInputElement>('span');
|
||||
spanHTMLElement.dispatchEvent(new Event('mouseenter'));
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement.querySelector('.adf-copy-tooltip')).not.toBeNull();
|
||||
}));
|
||||
|
||||
it('should not show tooltip when element it is not hovered', (() => {
|
||||
const spanHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('span');
|
||||
const spanHTMLElement = element.querySelector<HTMLInputElement>('span');
|
||||
spanHTMLElement.dispatchEvent(new Event('mouseenter'));
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement.querySelector('.adf-copy-tooltip')).not.toBeNull();
|
||||
@@ -119,7 +119,7 @@ describe('CopyClipboardDirective', () => {
|
||||
}));
|
||||
|
||||
it('should copy the content of element when click it', fakeAsync(() => {
|
||||
const spanHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('span');
|
||||
const spanHTMLElement = element.querySelector<HTMLInputElement>('span');
|
||||
fixture.detectChanges();
|
||||
spyOn(document, 'execCommand');
|
||||
spanHTMLElement.dispatchEvent(new Event('click'));
|
||||
@@ -129,7 +129,7 @@ describe('CopyClipboardDirective', () => {
|
||||
}));
|
||||
|
||||
it('should not copy the content of element when click it', fakeAsync(() => {
|
||||
const spanHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('span');
|
||||
const spanHTMLElement = element.querySelector<HTMLInputElement>('span');
|
||||
fixture.detectChanges();
|
||||
spyOn(document, 'execCommand');
|
||||
spanHTMLElement.dispatchEvent(new Event('mouseleave'));
|
||||
|
@@ -30,6 +30,7 @@ export class ClipboardService {
|
||||
|
||||
/**
|
||||
* Checks if the target element can have its text copied.
|
||||
*
|
||||
* @param target Target HTML element
|
||||
* @returns True if the text can be copied, false otherwise
|
||||
*/
|
||||
@@ -42,6 +43,7 @@ export class ClipboardService {
|
||||
|
||||
/**
|
||||
* Copies text from an HTML element to the clipboard.
|
||||
*
|
||||
* @param target HTML element to be copied
|
||||
* @param message Snackbar message to alert when copying happens
|
||||
*/
|
||||
@@ -60,6 +62,7 @@ export class ClipboardService {
|
||||
|
||||
/**
|
||||
* Copies a text string to the clipboard.
|
||||
*
|
||||
* @param content Text to copy
|
||||
* @param message Snackbar message to alert when copying happens
|
||||
*/
|
||||
|
Reference in New Issue
Block a user