mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix FolderEditDirective unit tests
This commit is contained in:
committed by
VitoAlbano
parent
4bb7c99924
commit
a3e1a65868
@@ -51,7 +51,7 @@ describe('FolderEditDirective', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [ContentTestingModule],
|
imports: [ContentTestingModule, FolderEditDirective],
|
||||||
declarations: [TestComponent]
|
declarations: [TestComponent]
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(TestComponent);
|
fixture = TestBed.createComponent(TestComponent);
|
||||||
@@ -69,8 +69,7 @@ describe('FolderEditDirective', () => {
|
|||||||
|
|
||||||
spyOn(dialog, 'open').and.returnValue(dialogRefMock);
|
spyOn(dialog, 'open').and.returnValue(dialogRefMock);
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line
|
it('should not emit folderEdit event when input value is undefined', async () => {
|
||||||
xit('should not emit folderEdit event when input value is undefined', async () => {
|
|
||||||
spyOn(dialogRefMock, 'afterClosed').and.returnValue(of(null));
|
spyOn(dialogRefMock, 'afterClosed').and.returnValue(of(null));
|
||||||
spyOn(contentService.folderEdit, 'next');
|
spyOn(contentService.folderEdit, 'next');
|
||||||
|
|
||||||
@@ -81,8 +80,7 @@ describe('FolderEditDirective', () => {
|
|||||||
expect(contentService.folderEdit.next).not.toHaveBeenCalled();
|
expect(contentService.folderEdit.next).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line
|
it('should emit success event with node if the folder creation was successful', async () => {
|
||||||
xit('should emit success event with node if the folder creation was successful', async () => {
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const testNode: any = {};
|
const testNode: any = {};
|
||||||
|
|
||||||
@@ -93,8 +91,7 @@ describe('FolderEditDirective', () => {
|
|||||||
await fixture.whenStable();
|
await fixture.whenStable();
|
||||||
expect(fixture.componentInstance.successParameter).toBe(testNode);
|
expect(fixture.componentInstance.successParameter).toBe(testNode);
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line
|
it('should open the dialog with the proper title', async () => {
|
||||||
xit('should open the dialog with the proper title', async () => {
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
element.triggerEventHandler('click', event);
|
element.triggerEventHandler('click', event);
|
||||||
|
|
||||||
|
@@ -26,7 +26,8 @@ import { ContentService } from '../common/services/content.service';
|
|||||||
const DIALOG_WIDTH: number = 400;
|
const DIALOG_WIDTH: number = 400;
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[adf-edit-folder]'
|
selector: '[adf-edit-folder]',
|
||||||
|
standalone: true
|
||||||
})
|
})
|
||||||
export class FolderEditDirective {
|
export class FolderEditDirective {
|
||||||
/** Folder node to edit. */
|
/** Folder node to edit. */
|
||||||
|
Reference in New Issue
Block a user