This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it("should set input property 'text' equal to folder title in <custom-inline-edit/>", () => { | |
| // arrange | |
| component.folder = folder; | |
| fixture.detectChanges(); | |
| // act | |
| let inlineEditElement: DebugElement = editDescriptionElement = fixture.debugElement.query( | |
| By.css("custom-inline-edit")); | |
| // assert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it("should emit folder with the new title on editTitleConfiremd", () => { | |
| // arrange | |
| component.folder.title = "Harry Potter"; | |
| fixture.detectChanges(); | |
| spyOn(component.folderUpdated, "emit"); | |
| // act | |
| let inlineEditElement: DebugElement = editDescriptionElement = fixture.debugElement.query( | |
| By.css("custom-inline-edit")); | |
| inlineEditElement.triggerEventHandler("editConfirmed", "Albus Dumbledore"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <span *ngIf="folder" class="folder-name"> | |
| <custom-inline-edit [text]="folderTitle" | |
| (editConfirmed)="editTitleConfirmed($event)" | |
| (canceled)="editFolderCanceled.emit($event)"> | |
| </custom-inline-edit> | |
| </span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public editTitleConfirmed(title: string): void { | |
| if (!title) { | |
| return; | |
| } | |
| this.folderUpdated.emit({ ...this.folder, title: title }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it("should emit folder with the new title on Enter key", fakeAsync(() => { | |
| // arrange | |
| spyOn(component.folderUpdated, "emit"); | |
| // act | |
| let inlineEditInputDebugElement: DebugElement = fixture.debugElement.query( | |
| By.css("custom-inline-edit #title-input")); | |
| let inlineEditInputElement: any = editDescriptionElement.nativeElement; | |
| inlineEditInputElement.value = "Albus Dumbledore"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public selectFolder(folder: IFolder): void { | |
| this.selectedFolder = folder; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe("selectFolder", () => { | |
| it("should update selectedFolder property with passed folder", () => { | |
| // arrange | |
| component.selectedFolder = undefined; | |
| let folder: IFolder = new Folder(1, "Harry Potter"); | |
| // act | |
| component.selectFolder(folder); | |
| // assert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| beforeEach( | |
| async(() => { | |
| TestBed.configureTestingModule({ | |
| providers: [SomeProvider], | |
| declarations: [DropzoneComponent, DocumentsComponent, FoldersComponent], | |
| schemas: [CUSTOM_ELEMENTS_SCHEMA] | |
| }).compileComponents(); | |
| }) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <span [class.isActive]="isActive()">{{title}}</span> | |
| <folders [folders]="folders" | |
| [activeFolder]="activeFolder" | |
| (folderSelected)="folderSelected($event)"> | |
| </folders> | |
| <documents [documents]="documents" | |
| (documentOpened)="documentOpened($event)"> | |
| </documents> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| beforeEach( | |
| async(() => { | |
| TestBed.configureTestingModule({ | |
| providers: [SomeProvider], | |
| declarations: [DropzoneComponent], | |
| schemas: [CUSTOM_ELEMENTS_SCHEMA] | |
| }).compileComponents(); | |
| }) | |
| ); |
OlderNewer