Last active
May 7, 2018 21:50
-
-
Save advorkina/a12f3bef3172b3a76692d42f91ed1d3e to your computer and use it in GitHub Desktop.
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"; | |
inlineEditInputElement.dispatchEvent(new Event("input")); | |
inlineEditInputDebugElement.triggerEventHandler("keydown.enter", null); | |
fixture.detectChanges(); | |
// assert | |
let emittedFolder: IFolder = (component.folderUpdated.emit as any).calls.mostRecent().args[0]; | |
expect(emittedFolder.title).toEqual("Albus Dumbledore"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment