Skip to content

Instantly share code, notes, and snippets.

@advorkina
Last active May 7, 2018 21:29
Show Gist options
  • Save advorkina/8ce90a78d37087373b46955a68ced8ef to your computer and use it in GitHub Desktop.
Save advorkina/8ce90a78d37087373b46955a68ced8ef to your computer and use it in GitHub Desktop.
Testing Input() properties in Angular
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
expect(inlineEditElement.nativeElement.attributes["ng-reflect-text"].value).
toBe(folder.title);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment