Last active
December 4, 2019 17:24
-
-
Save advorkina/47c2e7a763531c514687c06b631cfd81 to your computer and use it in GitHub Desktop.
Testing Output() event
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"); | |
// assert | |
let emittedFolder: IFolder = component.folderUpdated.emit.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
editTitleConfiremd should read editTitleConfirmed
great test example!