mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[ADF-3726] Add copy to clipbouard support to card view properties (#5565)
This commit is contained in:
@@ -23,6 +23,7 @@ import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { CardViewDateItemComponent } from './card-view-dateitem.component';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { ClipboardService } from '../../../clipboard/clipboard.service';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
|
||||
describe('CardViewDateItemComponent', () => {
|
||||
@@ -219,6 +220,20 @@ describe('CardViewDateItemComponent', () => {
|
||||
);
|
||||
}));
|
||||
|
||||
it('should copy value to clipboard on double click', () => {
|
||||
const clipboardService = TestBed.get(ClipboardService);
|
||||
spyOn(clipboardService, 'copyContentToClipboard');
|
||||
|
||||
component.editable = false;
|
||||
fixture.detectChanges();
|
||||
|
||||
const doubleClickEl = fixture.debugElement.query(By.css(`[data-automation-id="card-dateitem-${component.property.key}"] span`));
|
||||
doubleClickEl.triggerEventHandler('dblclick', new MouseEvent('dblclick'));
|
||||
|
||||
fixture.detectChanges();
|
||||
expect(clipboardService.copyContentToClipboard).toHaveBeenCalledWith('Jul 10, 2017', 'CORE.METADATA.ACCESSIBILITY.COPY_TO_CLIPBOARD_MESSAGE');
|
||||
});
|
||||
|
||||
describe('clear icon', () => {
|
||||
it('should render the clear icon in case of displayClearAction:true', () => {
|
||||
component.editable = true;
|
||||
|
Reference in New Issue
Block a user